update version

master
neuecc 2021-01-07 11:59:31 +09:00
parent 478e2998a8
commit 143d97a73b
7 changed files with 137 additions and 53 deletions

2
.gitignore vendored
View File

@ -255,3 +255,5 @@ src/UniTask/DOTween.Modules.Player.csproj
src/UniTask/Assembly-CSharp.Player.csproj
src/UniTask/Unity.EditorCoroutines.Editor.csproj
src/UniTask/.vsconfig

View File

@ -145,50 +145,50 @@ namespace Cysharp.Threading.Tasks.Sample
}
}
public class LoggingDecorator : IAsyncDecorator
{
public async UniTask<ResponseContext> SendAsync(RequestContext context, CancellationToken cancellationToken, Func<RequestContext, CancellationToken, UniTask<ResponseContext>> next)
{
var sw = Stopwatch.StartNew();
try
{
UnityEngine.Debug.Log("Start Network Request:" + context.Path);
//public class LoggingDecorator : IAsyncDecorator
//{
// public async UniTask<ResponseContext> SendAsync(RequestContext context, CancellationToken cancellationToken, Func<RequestContext, CancellationToken, UniTask<ResponseContext>> next)
// {
// var sw = Stopwatch.StartNew();
// try
// {
// UnityEngine.Debug.Log("Start Network Request:" + context.Path);
var response = await next(context, cancellationToken);
// var response = await next(context, cancellationToken);
UnityEngine.Debug.Log($"Complete Network Request: {context.Path} , Elapsed: {sw.Elapsed}, Size: {response.GetRawData().Length}");
// UnityEngine.Debug.Log($"Complete Network Request: {context.Path} , Elapsed: {sw.Elapsed}, Size: {response.GetRawData().Length}");
return response;
}
catch (Exception ex)
{
if (ex is OperationCanceledException)
{
UnityEngine.Debug.Log("Request Canceled:" + context.Path);
}
else if (ex is TimeoutException)
{
UnityEngine.Debug.Log("Request Timeout:" + context.Path);
}
else if (ex is UnityWebRequestException webex)
{
if (webex.IsHttpError)
{
UnityEngine.Debug.Log($"Request HttpError: {context.Path} Code:{webex.ResponseCode} Message:{webex.Message}");
}
else if (webex.IsNetworkError)
{
UnityEngine.Debug.Log($"Request NetworkError: {context.Path} Code:{webex.ResponseCode} Message:{webex.Message}");
}
}
throw;
}
finally
{
/* log other */
}
}
}
// return response;
// }
// catch (Exception ex)
// {
// if (ex is OperationCanceledException)
// {
// UnityEngine.Debug.Log("Request Canceled:" + context.Path);
// }
// else if (ex is TimeoutException)
// {
// UnityEngine.Debug.Log("Request Timeout:" + context.Path);
// }
// else if (ex is UnityWebRequestException webex)
// {
// if (webex.IsHttpError)
// {
// UnityEngine.Debug.Log($"Request HttpError: {context.Path} Code:{webex.ResponseCode} Message:{webex.Message}");
// }
// else if (webex.IsNetworkError)
// {
// UnityEngine.Debug.Log($"Request NetworkError: {context.Path} Code:{webex.ResponseCode} Message:{webex.Message}");
// }
// }
// throw;
// }
// finally
// {
// /* log other */
// }
// }
//}
public class SetupHeaderDecorator : IAsyncDecorator
{

View File

@ -428,15 +428,15 @@ public class SandboxMain : MonoBehaviour
Debug.Log("after");
}
private async UniTaskVoid ExecuteAsync()
{
var req = UnityWebRequest.Get("https://google.com/");
//private async UniTaskVoid ExecuteAsync()
//{
// var req = UnityWebRequest.Get("https://google.com/");
var v = await req.SendWebRequest().ToUniTask();
// req.Dispose();
Debug.Log($"{v.isDone} {v.isHttpError} {v.isNetworkError}");
Debug.Log(v.downloadHandler.text);
}
// var v = await req.SendWebRequest().ToUniTask();
// // req.Dispose();
// Debug.Log($"{v.isDone} {v.isHttpError} {v.isNetworkError}");
// Debug.Log(v.downloadHandler.text);
//}
private async void Go()
{
await UniTask.DelayFrame(0);
@ -569,8 +569,9 @@ public class SandboxMain : MonoBehaviour
{
var client = new NetworkClient("http://localhost:5000", TimeSpan.FromSeconds(2),
new QueueRequestDecorator(),
new LoggingDecorator());
new QueueRequestDecorator()
/*, new LoggingDecorator()*/
);
//new AppendTokenDecorator(),
//new SetupHeaderDecorator());

View File

@ -0,0 +1,54 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 61
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_EnablePreviewPackages: 0
m_EnablePackageDependencies: 0
m_AdvancedSettingsExpanded: 1
m_ScopedRegistriesSettingsExpanded: 1
oneTimeWarningShown: 0
m_Registries:
- m_Id: main
m_Name:
m_Url: https://packages.unity.com
m_Scopes: []
m_IsDefault: 1
m_Capabilities: 7
- m_Id: scoped:package.openupm.com
m_Name: package.openupm.com
m_Url: https://package.openupm.com
m_Scopes:
- com.demigiant.dotween
- com.openupm
m_IsDefault: 0
m_Capabilities: 0
m_UserSelectedRegistryName:
m_UserAddingNewScopedRegistry: 0
m_RegistryInfoDraft:
m_ErrorMessage:
m_Original:
m_Id: scoped:package.openupm.com
m_Name: package.openupm.com
m_Url: https://package.openupm.com
m_Scopes:
- com.demigiant.dotween
- com.openupm
m_IsDefault: 0
m_Capabilities: 0
m_Modified: 0
m_Name: package.openupm.com
m_Url: https://package.openupm.com
m_Scopes:
- com.demigiant.dotween
- com.openupm
m_SelectedScopeIndex: 0

View File

@ -1,2 +1,2 @@
m_EditorVersion: 2019.4.5f1
m_EditorVersionWithRevision: 2019.4.5f1 (81610f64359c)
m_EditorVersion: 2020.2.1f1
m_EditorVersionWithRevision: 2020.2.1f1 (270dd8c3da1c)

View File

@ -0,0 +1,8 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!890905787 &1
VersionControlSettings:
m_ObjectHideFlags: 0
m_Mode: Visible Meta Files
m_CollabEditorSettings:
inProgressEnabled: 1

View File

@ -0,0 +1,19 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!162 &1
EditorUserSettings:
m_ObjectHideFlags: 0
serializedVersion: 4
m_ConfigSettings:
vcSharedLogLevel:
value: 0d5e400f0650
flags: 0
m_VCAutomaticAdd: 1
m_VCDebugCom: 0
m_VCDebugCmd: 0
m_VCDebugOut: 0
m_SemanticMergeMode: 2
m_VCShowFailedCheckout: 1
m_VCOverwriteFailedCheckoutAssets: 1
m_VCOverlayIcons: 1
m_VCAllowAsyncUpdate: 0