diff --git a/src/UniTask/Assembly-CSharp-firstpass.csproj b/src/UniTask/Assembly-CSharp-firstpass.csproj new file mode 100644 index 0000000..fa87c3b --- /dev/null +++ b/src/UniTask/Assembly-CSharp-firstpass.csproj @@ -0,0 +1,734 @@ + + + + latest + + + Debug + AnyCPU + 10.0.20506 + 2.0 + + {CECB0124-DA37-D676-2B9E-00C5241684F4} + Library + Properties + Assembly-CSharp-firstpass + v4.7.1 + 512 + . + + + true + full + false + Temp\Bin\Debug\ + DEBUG;TRACE;UNITY_2020_2_1;UNITY_2020_2;UNITY_2020;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;USE_SEARCH_ENGINE_API;SCENE_TEMPLATE_MODULE;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;INCLUDE_DYNAMIC_GI;ENABLE_MONO_BDWGC;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_VIDEO;PLATFORM_STANDALONE;PLATFORM_STANDALONE_WIN;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;GFXDEVICE_WAITFOREVENT_MESSAGEPUMP;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_STANDARD_2_0;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;UNITY_PRO_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_LEGACY_INPUT_MANAGER;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER + prompt + 4 + 0169 + False + + + pdbonly + true + Temp\bin\Release\ + prompt + 4 + 0169 + False + + + true + true + false + false + false + + + {E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Package + 2.0.5 + GamePlugins:3 + StandaloneWindows64:19 + 2020.2.1f1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AIModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ARModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AccessibilityModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AndroidJNIModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AnimationModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AssetBundleModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.AudioModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterInputModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterRendererModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.CrashReportingModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.DSPGraphModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.DirectorModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.GIModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.GameCenterModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.GridModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.HotReloadModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.IMGUIModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ImageConversionModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.InputModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.InputLegacyModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.JSONSerializeModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.LocalizationModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ParticleSystemModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.PerformanceReportingModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ProfilerModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.ScreenCaptureModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.SharedInternalsModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteMaskModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteShapeModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.StreamingModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.SubstanceModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TLSModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.TextRenderingModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UIModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsNativeModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UNETModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UmbraModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityConnectModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityCurlModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityTestProtocolModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAudioModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestTextureModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestWWWModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.VFXModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.VideoModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.VirtualTexturingModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEngine.WindModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.CoreModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.GraphViewModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.PackageManagerUIModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.SceneTemplateModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsSamplesModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.UIServiceModule.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Managed\UnityEngine\UnityEditor.UnityConnectModule.dll + + + Library\PackageCache\com.unity.ext.nunit@1.0.5\net35\unity-custom\nunit.framework.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\ref\2.0.0\netstandard.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\Microsoft.Win32.Primitives.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.AppContext.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Collections.Concurrent.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Collections.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Collections.NonGeneric.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Collections.Specialized.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.ComponentModel.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.ComponentModel.EventBasedAsync.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.ComponentModel.Primitives.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.ComponentModel.TypeConverter.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Console.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Data.Common.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Diagnostics.Contracts.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Diagnostics.Debug.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Diagnostics.FileVersionInfo.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Diagnostics.Process.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Diagnostics.StackTrace.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Diagnostics.TextWriterTraceListener.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Diagnostics.Tools.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Diagnostics.TraceSource.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Diagnostics.Tracing.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Drawing.Primitives.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Dynamic.Runtime.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Globalization.Calendars.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Globalization.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Globalization.Extensions.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.IO.Compression.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.IO.Compression.ZipFile.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.IO.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.IO.FileSystem.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.IO.FileSystem.DriveInfo.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.IO.FileSystem.Primitives.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.IO.FileSystem.Watcher.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.IO.IsolatedStorage.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.IO.MemoryMappedFiles.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.IO.Pipes.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.IO.UnmanagedMemoryStream.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Linq.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Linq.Expressions.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Linq.Parallel.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Linq.Queryable.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Net.Http.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Net.NameResolution.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Net.NetworkInformation.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Net.Ping.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Net.Primitives.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Net.Requests.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Net.Security.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Net.Sockets.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Net.WebHeaderCollection.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Net.WebSockets.Client.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Net.WebSockets.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.ObjectModel.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Reflection.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Reflection.Extensions.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Reflection.Primitives.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Resources.Reader.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Resources.ResourceManager.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Resources.Writer.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Runtime.CompilerServices.VisualC.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Runtime.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Runtime.Extensions.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Runtime.Handles.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Runtime.InteropServices.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Runtime.InteropServices.RuntimeInformation.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Runtime.Numerics.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Runtime.Serialization.Formatters.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Runtime.Serialization.Json.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Runtime.Serialization.Primitives.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Runtime.Serialization.Xml.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Security.Claims.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Security.Cryptography.Algorithms.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Security.Cryptography.Csp.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Security.Cryptography.Encoding.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Security.Cryptography.Primitives.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Security.Cryptography.X509Certificates.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Security.Principal.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Security.SecureString.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Text.Encoding.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Text.Encoding.Extensions.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Text.RegularExpressions.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Threading.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Threading.Overlapped.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Threading.Tasks.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Threading.Tasks.Parallel.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Threading.Thread.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Threading.ThreadPool.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Threading.Timer.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.ValueTuple.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Xml.ReaderWriter.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Xml.XDocument.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Xml.XmlDocument.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Xml.XmlSerializer.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Xml.XPath.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netstandard\System.Xml.XPath.XDocument.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\Extensions\2.0.0\System.Numerics.Vectors.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\Extensions\2.0.0\System.Runtime.InteropServices.WindowsRuntime.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\mscorlib.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.ComponentModel.Composition.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.Core.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.Data.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.Drawing.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.IO.Compression.FileSystem.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.Net.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.Numerics.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.Runtime.Serialization.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.ServiceModel.Web.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.Transactions.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.Web.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.Windows.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.Xml.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.Xml.Linq.dll + + + C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\NetStandard\compat\2.0.0\shims\netfx\System.Xml.Serialization.dll + + + Library\ScriptAssemblies\Unity.VSCode.Editor.dll + + + Library\ScriptAssemblies\UnityEditor.CacheServer.dll + + + Library\ScriptAssemblies\Unity.VisualStudio.Editor.dll + + + Library\ScriptAssemblies\Unity.Addressables.dll + + + Library\ScriptAssemblies\Unity.ScriptableBuildPipeline.dll + + + Library\ScriptAssemblies\Unity.Addressables.Editor.dll + + + Library\ScriptAssemblies\Unity.ScriptableBuildPipeline.Editor.dll + + + Library\ScriptAssemblies\Unity.ResourceManager.dll + + + Library\ScriptAssemblies\Unity.Rider.Editor.dll + + + + + {B5929667-6CB2-8779-D894-4F69110C1A43} + UniTask.TextMeshPro + + + {9E0EF10C-B6E1-E08E-3160-7162D66F7EE0} + TempAsm + + + {7121D833-D063-D143-CFFC-CD50DDF1B3D1} + UniTask.DOTween + + + {78124C71-0355-1FB9-3AEB-7D573CD8E7CA} + UniTask.Addressables + + + {7F0F67EA-D985-C15F-AAE8-F643789B52A7} + UniTask.Linq + + + + + + diff --git a/src/UniTask/Assets/Editor/EditorRunnerChecker.cs b/src/UniTask/Assets/Editor/EditorRunnerChecker.cs index 46372f9..b91524d 100644 --- a/src/UniTask/Assets/Editor/EditorRunnerChecker.cs +++ b/src/UniTask/Assets/Editor/EditorRunnerChecker.cs @@ -20,8 +20,9 @@ public static class EditorRunnerChecker { Debug.Log("Start"); - var r = await UnityWebRequest.Get("https://bing.com/").SendWebRequest().ToUniTask(); - Debug.Log(r.downloadHandler.text.Substring(0, 100)); + //var r = await UnityWebRequest.Get("https://bing.com/").SendWebRequest().ToUniTask(); + //Debug.Log(r.downloadHandler.text.Substring(0, 100)); + await UniTask.Yield(); Debug.Log("End"); } diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Internal/UnityWebRequestExtensions.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Internal/UnityWebRequestExtensions.cs index 33cc593..0da9f5a 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Internal/UnityWebRequestExtensions.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Internal/UnityWebRequestExtensions.cs @@ -7,6 +7,8 @@ using UnityEngine.Networking; namespace Cysharp.Threading.Tasks.Internal { +#if ENABLE_UNITYWEBREQUEST && (!UNITY_2019_1_OR_NEWER || UNITASK_WEBREQUEST_SUPPORT) + internal static class UnityWebRequestResultExtensions { public static bool IsError(this UnityWebRequest unityWebRequest) @@ -21,4 +23,6 @@ namespace Cysharp.Threading.Tasks.Internal #endif } } + +#endif } \ No newline at end of file diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.cs index 95c44c5..6ef5014 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.cs @@ -2,7 +2,9 @@ using System.Threading; using UnityEngine; +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT using UnityEngine.EventSystems; +#endif namespace Cysharp.Threading.Tasks.Triggers { @@ -715,6 +717,7 @@ namespace Cysharp.Threading.Tasks.Triggers #endregion #region CollisionEnter +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT public interface IAsyncOnCollisionEnterHandler { @@ -771,9 +774,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnCollisionEnterHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnCollisionEnterAsync(); } } +#endif #endregion #region CollisionEnter2D +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS2D_SUPPORT public interface IAsyncOnCollisionEnter2DHandler { @@ -830,9 +835,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnCollisionEnter2DHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnCollisionEnter2DAsync(); } } +#endif #endregion #region CollisionExit +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT public interface IAsyncOnCollisionExitHandler { @@ -889,9 +896,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnCollisionExitHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnCollisionExitAsync(); } } +#endif #endregion #region CollisionExit2D +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS2D_SUPPORT public interface IAsyncOnCollisionExit2DHandler { @@ -948,9 +957,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnCollisionExit2DHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnCollisionExit2DAsync(); } } +#endif #endregion #region CollisionStay +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT public interface IAsyncOnCollisionStayHandler { @@ -1007,9 +1018,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnCollisionStayHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnCollisionStayAsync(); } } +#endif #endregion #region CollisionStay2D +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS2D_SUPPORT public interface IAsyncOnCollisionStay2DHandler { @@ -1066,9 +1079,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnCollisionStay2DHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnCollisionStay2DAsync(); } } +#endif #endregion #region ControllerColliderHit +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT public interface IAsyncOnControllerColliderHitHandler { @@ -1125,6 +1140,7 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnControllerColliderHitHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnControllerColliderHitAsync(); } } +#endif #endregion #region Disable @@ -1423,6 +1439,7 @@ namespace Cysharp.Threading.Tasks.Triggers #endregion #region JointBreak +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT public interface IAsyncOnJointBreakHandler { @@ -1479,9 +1496,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnJointBreakHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnJointBreakAsync(); } } +#endif #endregion #region JointBreak2D +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS2D_SUPPORT public interface IAsyncOnJointBreak2DHandler { @@ -1538,6 +1557,7 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnJointBreak2DHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnJointBreak2DAsync(); } } +#endif #endregion #region MouseDown @@ -2145,7 +2165,7 @@ namespace Cysharp.Threading.Tasks.Triggers #endregion #region ParticleUpdateJobScheduled -#if UNITY_2019_3_OR_NEWER +#if UNITY_2019_3_OR_NEWER && (!UNITY_2019_1_OR_NEWER || UNITASK_PARTICLESYSTEM_SUPPORT) public interface IAsyncOnParticleUpdateJobScheduledHandler { @@ -2796,6 +2816,7 @@ namespace Cysharp.Threading.Tasks.Triggers #endregion #region TriggerEnter +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT public interface IAsyncOnTriggerEnterHandler { @@ -2852,9 +2873,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnTriggerEnterHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnTriggerEnterAsync(); } } +#endif #endregion #region TriggerEnter2D +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS2D_SUPPORT public interface IAsyncOnTriggerEnter2DHandler { @@ -2911,9 +2934,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnTriggerEnter2DHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnTriggerEnter2DAsync(); } } +#endif #endregion #region TriggerExit +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT public interface IAsyncOnTriggerExitHandler { @@ -2970,9 +2995,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnTriggerExitHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnTriggerExitAsync(); } } +#endif #endregion #region TriggerExit2D +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS2D_SUPPORT public interface IAsyncOnTriggerExit2DHandler { @@ -3029,9 +3056,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnTriggerExit2DHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnTriggerExit2DAsync(); } } +#endif #endregion #region TriggerStay +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT public interface IAsyncOnTriggerStayHandler { @@ -3088,9 +3117,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnTriggerStayHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnTriggerStayAsync(); } } +#endif #endregion #region TriggerStay2D +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS2D_SUPPORT public interface IAsyncOnTriggerStay2DHandler { @@ -3147,6 +3178,7 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnTriggerStay2DHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnTriggerStay2DAsync(); } } +#endif #endregion #region Validate @@ -3386,6 +3418,7 @@ namespace Cysharp.Threading.Tasks.Triggers #endregion #region BeginDrag +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnBeginDragHandler { @@ -3442,9 +3475,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnBeginDragHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnBeginDragAsync(); } } +#endif #endregion #region Cancel +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnCancelHandler { @@ -3501,9 +3536,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnCancelHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnCancelAsync(); } } +#endif #endregion #region Deselect +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnDeselectHandler { @@ -3560,9 +3597,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnDeselectHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnDeselectAsync(); } } +#endif #endregion #region Drag +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnDragHandler { @@ -3619,9 +3658,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnDragHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnDragAsync(); } } +#endif #endregion #region Drop +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnDropHandler { @@ -3678,9 +3719,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnDropHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnDropAsync(); } } +#endif #endregion #region EndDrag +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnEndDragHandler { @@ -3737,9 +3780,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnEndDragHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnEndDragAsync(); } } +#endif #endregion #region InitializePotentialDrag +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnInitializePotentialDragHandler { @@ -3796,9 +3841,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnInitializePotentialDragHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnInitializePotentialDragAsync(); } } +#endif #endregion #region Move +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnMoveHandler { @@ -3855,9 +3902,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnMoveHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnMoveAsync(); } } +#endif #endregion #region PointerClick +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnPointerClickHandler { @@ -3914,9 +3963,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnPointerClickHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnPointerClickAsync(); } } +#endif #endregion #region PointerDown +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnPointerDownHandler { @@ -3973,9 +4024,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnPointerDownHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnPointerDownAsync(); } } +#endif #endregion #region PointerEnter +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnPointerEnterHandler { @@ -4032,9 +4085,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnPointerEnterHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnPointerEnterAsync(); } } +#endif #endregion #region PointerExit +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnPointerExitHandler { @@ -4091,9 +4146,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnPointerExitHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnPointerExitAsync(); } } +#endif #endregion #region PointerUp +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnPointerUpHandler { @@ -4150,9 +4207,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnPointerUpHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnPointerUpAsync(); } } +#endif #endregion #region Scroll +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnScrollHandler { @@ -4209,9 +4268,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnScrollHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnScrollAsync(); } } +#endif #endregion #region Select +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnSelectHandler { @@ -4268,9 +4329,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnSelectHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnSelectAsync(); } } +#endif #endregion #region Submit +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnSubmitHandler { @@ -4327,9 +4390,11 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnSubmitHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnSubmitAsync(); } } +#endif #endregion #region UpdateSelected +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT public interface IAsyncOnUpdateSelectedHandler { @@ -4386,6 +4451,7 @@ namespace Cysharp.Threading.Tasks.Triggers return ((IAsyncOnUpdateSelectedHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnUpdateSelectedAsync(); } } +#endif #endregion } \ No newline at end of file diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.tt b/src/UniTask/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.tt index 4162ba8..815d257 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.tt +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.tt @@ -106,24 +106,36 @@ Func<(string argType, string argName)[], string> BuildMethodArgument = x => string.Join(", ", x.Select(y => y.argType + " " + y.argName)); Func<(string argType, string argName)[], string> BuildResultParameter = x => x.Length == 0 ? "AsyncUnit.Default" : "(" + string.Join(", ", x.Select(y => y.argName)) + ")"; - Func Is2019_3 = x => x == "ParticleUpdateJobScheduled"; + Func IsParticleSystem = x => x == "ParticleUpdateJobScheduled"; Func IsMouseTrigger = x => x.StartsWith("Mouse"); + Func RequirePhysicsModule = x => (x.StartsWith("Collision") || x.StartsWith("Collider") || x.StartsWith("ControllerCollider") || x.StartsWith("Joint") || x.StartsWith("Trigger")) + ? (x.Contains("2D") ? "UNITASK_PHYSICS2D_SUPPORT" : "UNITASK_PHYSICS_SUPPORT") + : null; + Func IsUguiSystem = x => x != null; #> #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Threading; using UnityEngine; +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT using UnityEngine.EventSystems; +#endif namespace Cysharp.Threading.Tasks.Triggers { <# foreach(var t in triggers) { #> #region <#= t.triggerName #> -<# if(Is2019_3(t.triggerName)) { #> -#if UNITY_2019_3_OR_NEWER +<# if(IsUguiSystem(t.handlerInterface)) { #> +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT +<# } #> +<# if(IsParticleSystem(t.triggerName)) { #> +#if UNITY_2019_3_OR_NEWER && (!UNITY_2019_1_OR_NEWER || UNITASK_PARTICLESYSTEM_SUPPORT) <# } #> <# if(IsMouseTrigger(t.triggerName)) { #> #if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO) +<# } #> +<# if(RequirePhysicsModule(t.triggerName) != null) { #> +#if !UNITY_2019_1_OR_NEWER || <#= RequirePhysicsModule(t.triggerName) #> <# } #> public interface <#= ToInterfaceName(t.methodName) #> @@ -181,7 +193,13 @@ namespace Cysharp.Threading.Tasks.Triggers return ((<#= ToInterfaceName(t.methodName) #>)new AsyncTriggerHandler<<#= t.returnType #>>(this, cancellationToken, true)).<#= t.methodName #>Async(); } } -<# if(Is2019_3(t.triggerName) || IsMouseTrigger(t.triggerName)) { #> +<# if(IsUguiSystem(t.handlerInterface)) { #> +#endif +<# } #> +<# if(RequirePhysicsModule(t.triggerName) != null) { #> +#endif +<# } #> +<# if(IsParticleSystem(t.triggerName) || IsMouseTrigger(t.triggerName)) { #> #endif <# } #> #endregion diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.asmdef b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.asmdef index 1c888bf..f82d22a 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.asmdef +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.asmdef @@ -1,7 +1,7 @@ { "name": "UniTask", - "references": [ - ], + "rootNamespace": "", + "references": [], "includePlatforms": [], "excludePlatforms": [], "allowUnsafeCode": false, @@ -14,6 +14,31 @@ "name": "com.unity.modules.assetbundle", "expression": "", "define": "UNITASK_ASSETBUNDLE_SUPPORT" + }, + { + "name": "com.unity.modules.physics", + "expression": "", + "define": "UNITASK_PHYSICS_SUPPORT" + }, + { + "name": "com.unity.modules.physics2d", + "expression": "", + "define": "UNITASK_PHYSICS2D_SUPPORT" + }, + { + "name": "com.unity.modules.particlesystem", + "expression": "", + "define": "UNITASK_PARTICLESYSTEM_SUPPORT" + }, + { + "name": "com.unity.ugui", + "expression": "", + "define": "UNITASK_UGUI_SUPPORT" + }, + { + "name": "com.unity.modules.unitywebrequestwww", + "expression": "", + "define": "UNITASK_WEBREQUEST_SUPPORT" } ], "noEngineReferences": false diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.cs index 33c8694..ebb44d0 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.cs @@ -5,7 +5,7 @@ using System.Runtime.CompilerServices; using System.Threading; using UnityEngine; using Cysharp.Threading.Tasks.Internal; -#if ENABLE_UNITYWEBREQUEST +#if ENABLE_UNITYWEBREQUEST && (!UNITY_2019_1_OR_NEWER || UNITASK_WEBREQUEST_SUPPORT) using UnityEngine.Networking; #endif @@ -1221,7 +1221,7 @@ namespace Cysharp.Threading.Tasks #endregion #endif -#if ENABLE_UNITYWEBREQUEST +#if ENABLE_UNITYWEBREQUEST && (!UNITY_2019_1_OR_NEWER || UNITASK_WEBREQUEST_SUPPORT) #region UnityWebRequestAsyncOperation public static UnityWebRequestAsyncOperationAwaiter GetAwaiter(this UnityWebRequestAsyncOperation asyncOperation) diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs index 6f7bec6..11ebd63 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs @@ -1,5 +1,5 @@ #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT using System; using System.Threading; using UnityEngine; @@ -821,4 +821,6 @@ namespace Cysharp.Threading.Tasks } } } -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityBindingExtensions.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityBindingExtensions.cs index f693b0d..749f02a 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityBindingExtensions.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityBindingExtensions.cs @@ -1,12 +1,15 @@ using System; using System.Threading; using UnityEngine; +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT using UnityEngine.UI; +#endif namespace Cysharp.Threading.Tasks { public static class UnityBindingExtensions { +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT // -> Text public static void BindTo(this IUniTaskAsyncEnumerable source, Text text, bool rebindOnError = true) @@ -180,6 +183,7 @@ namespace Cysharp.Threading.Tasks } } } +#endif // -> Action diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityWebRequestException.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityWebRequestException.cs index 2386a74..d2a37ce 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityWebRequestException.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityWebRequestException.cs @@ -1,4 +1,4 @@ -#if ENABLE_UNITYWEBREQUEST +#if ENABLE_UNITYWEBREQUEST && (!UNITY_2019_1_OR_NEWER || UNITASK_WEBREQUEST_SUPPORT) using System; using System.Collections.Generic; diff --git a/src/UniTask/Assets/Scenes/MiddlewareSample.cs b/src/UniTask/Assets/Scenes/MiddlewareSample.cs index c64ca76..01ab778 100644 --- a/src/UniTask/Assets/Scenes/MiddlewareSample.cs +++ b/src/UniTask/Assets/Scenes/MiddlewareSample.cs @@ -1,471 +1,471 @@ -using Cysharp.Threading.Tasks; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using UnityEngine; -using UnityEngine.Networking; -using UnityEngine.SceneManagement; -using UnityEngine.UI; - -namespace Cysharp.Threading.Tasks.Sample -{ - //public class Sample2 - //{ - // public Sample2() - // { - // // デコレーターの詰まったClientを生成(これは一度作ったらフィールドに保存可) - // var client = new NetworkClient("http://localhost", TimeSpan.FromSeconds(10), - // new QueueRequestDecorator(), - // new LoggingDecorator(), - // new AppendTokenDecorator(), - // new SetupHeaderDecorator()); - - - // await client.PostAsync("/User/Register", new { Id = 100 }); - - - // } - //} - - - public class ReturnToTitleDecorator : IAsyncDecorator - { - public async UniTask SendAsync(RequestContext context, CancellationToken cancellationToken, Func> next) - { - try - { - return await next(context, cancellationToken); - } - catch (Exception ex) - { - if (ex is OperationCanceledException) - { - // キャンセルはきっと想定されている処理なのでそのまんまスルー(呼び出し側でOperationCanceledExceptionとして飛んでいく) - throw; - } - - if (ex is UnityWebRequestException uwe) - { - // ステータスコードを使って、タイトルに戻す例外です、とかリトライさせる例外です、とかハンドリングさせると便利 - // if (uwe.ResponseCode) { }... - } - - // サーバー例外のMessageを直接出すなんて乱暴なことはデバッグ時だけですよ勿論。 - var result = await MessageDialog.ShowAsync(ex.Message); - - // OK か Cancelかで分岐するなら。今回はボタン一個、OKのみの想定なので無視 - // if (result == DialogResult.Ok) { }... - - // シーン呼び出しはawaitしないこと!awaitして正常終了しちゃうと、この通信の呼び出し元に処理が戻って続行してしまいます - // のでForget。 - SceneManager.LoadSceneAsync("TitleScene").ToUniTask().Forget(); - - - // そしてOperationCanceledExceptionを投げて、この通信の呼び出し元の処理はキャンセル扱いにして終了させる - throw new OperationCanceledException(); - } - } - } - - public enum DialogResult - { - Ok, - Cancel - } - - public static class MessageDialog - { - public static async UniTask ShowAsync(string message) - { - // (例えば)Prefabで作っておいたダイアログを生成する - var view = await Resources.LoadAsync("Prefabs/Dialog"); - - // Ok, Cancelボタンのどちらかが押されるのを待機 - return await (view as GameObject).GetComponent().ClickResult; - } - } - - public class MessageDialogView : MonoBehaviour - { - [SerializeField] Button okButton = default; - [SerializeField] Button closeButton = default; - - UniTaskCompletionSource taskCompletion; - - // これでどちらかが押されるまで無限に待つを表現 - public UniTask ClickResult => taskCompletion.Task; - - private void Start() - { - taskCompletion = new UniTaskCompletionSource(); - - okButton.onClick.AddListener(() => - { - taskCompletion.TrySetResult(DialogResult.Ok); - }); - - closeButton.onClick.AddListener(() => - { - taskCompletion.TrySetResult(DialogResult.Cancel); - }); - } - - // もしボタンが押されずに消滅した場合にネンノタメ。 - private void OnDestroy() - { - taskCompletion.TrySetResult(DialogResult.Cancel); - } - } - - public class MockDecorator : IAsyncDecorator - { - Dictionary mock; - - // Pathと型を1:1にして事前定義したオブジェクトを返す辞書を渡す - public MockDecorator(Dictionary mock) - { - this.mock = mock; - } - - public UniTask SendAsync(RequestContext context, CancellationToken cancellationToken, Func> next) - { - if (mock.TryGetValue(context.Path, out var value)) - { - // 一致したものがあればそれを返す(実際の通信は行わない) - return new UniTask(new ResponseContext(value)); - } - else - { - return next(context, cancellationToken); - } - } - } - - //public class LoggingDecorator : IAsyncDecorator - //{ - // public async UniTask SendAsync(RequestContext context, CancellationToken cancellationToken, Func> next) - // { - // var sw = Stopwatch.StartNew(); - // try - // { - // UnityEngine.Debug.Log("Start Network Request:" + context.Path); - - // var response = await next(context, cancellationToken); - - // 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 */ - // } - // } - //} - - public class SetupHeaderDecorator : IAsyncDecorator - { - public async UniTask SendAsync(RequestContext context, CancellationToken cancellationToken, Func> next) - { - context.RequestHeaders["x-app-timestamp"] = context.Timestamp.ToString(); - context.RequestHeaders["x-user-id"] = "132141411"; // どこかから持ってくる - context.RequestHeaders["x-access-token"] = "fafafawfafewaea"; // どこかから持ってくる2 - - var respsonse = await next(context, cancellationToken); - - var nextToken = respsonse.ResponseHeaders["token"]; - // UserProfile.Token = nextToken; // どこかにセットするということにする - - return respsonse; - } - } - - - public class AppendTokenDecorator : IAsyncDecorator - { - public async UniTask SendAsync(RequestContext context, CancellationToken cancellationToken, Func> next) - { - string token = "token"; // どっかから取ってくるということにする - RETRY: - try - { - context.RequestHeaders["x-accesss-token"] = token; - return await next(context, cancellationToken); - } - catch (UnityWebRequestException ex) - { - // 例えば700はTokenを再取得してください的な意味だったとする - if (ex.ResponseCode == 700) - { - // 別口でTokenを取得します的な処理 - var newToken = await new NetworkClient(context.BasePath, context.Timeout).PostAsync("/Auth/GetToken", "access_token", cancellationToken); - context.Reset(this); - goto RETRY; - } - - goto RETRY; - } - } - } - - public class QueueRequestDecorator : IAsyncDecorator - { - readonly Queue<(UniTaskCompletionSource, RequestContext, CancellationToken, Func>)> q = new Queue<(UniTaskCompletionSource, RequestContext, CancellationToken, Func>)>(); - bool running; - - public async UniTask SendAsync(RequestContext context, CancellationToken cancellationToken, Func> next) - { - if (q.Count == 0) - { - return await next(context, cancellationToken); - } - else - { - var completionSource = new UniTaskCompletionSource(); - q.Enqueue((completionSource, context, cancellationToken, next)); - if (!running) - { - Run().Forget(); - } - return await completionSource.Task; - } - } - - async UniTaskVoid Run() - { - running = true; - try - { - while (q.Count != 0) - { - var (tcs, context, cancellationToken, next) = q.Dequeue(); - try - { - var response = await next(context, cancellationToken); - tcs.TrySetResult(response); - } - catch (Exception ex) - { - tcs.TrySetException(ex); - } - } - } - finally - { - running = false; - } - } - } - - - public class RequestContext - { - int decoratorIndex; - readonly IAsyncDecorator[] decorators; - Dictionary headers; - - public string BasePath { get; } - public string Path { get; } - public object Value { get; } - public TimeSpan Timeout { get; } - public DateTimeOffset Timestamp { get; private set; } - - public IDictionary RequestHeaders - { - get - { - if (headers == null) - { - headers = new Dictionary(); - } - return headers; - } - } - - public RequestContext(string basePath, string path, object value, TimeSpan timeout, IAsyncDecorator[] filters) - { - this.decoratorIndex = -1; - this.decorators = filters; - this.BasePath = basePath; - this.Path = path; - this.Value = value; - this.Timeout = timeout; - this.Timestamp = DateTimeOffset.UtcNow; - } - - internal Dictionary GetRawHeaders() => headers; - internal IAsyncDecorator GetNextDecorator() => decorators[++decoratorIndex]; - - public void Reset(IAsyncDecorator currentFilter) - { - decoratorIndex = Array.IndexOf(decorators, currentFilter); - if (headers != null) - { - headers.Clear(); - } - Timestamp = DateTimeOffset.UtcNow; - } - } - - public class ResponseContext - { - bool hasValue; - object value; - readonly byte[] bytes; - - public long StatusCode { get; } - public Dictionary ResponseHeaders { get; } - - public ResponseContext(object value, Dictionary header = null) - { - this.hasValue = true; - this.value = value; - this.StatusCode = 200; - this.ResponseHeaders = (header ?? new Dictionary()); - } - - public ResponseContext(byte[] bytes, long statusCode, Dictionary responseHeaders) - { - this.hasValue = false; - this.bytes = bytes; - this.StatusCode = statusCode; - this.ResponseHeaders = responseHeaders; - } - - public byte[] GetRawData() => bytes; - - public T GetResponseAs() - { - if (hasValue) - { - return (T)value; - } - - value = JsonUtility.FromJson(Encoding.UTF8.GetString(bytes)); - hasValue = true; - return (T)value; - } - } - - public interface IAsyncDecorator - { - UniTask SendAsync(RequestContext context, CancellationToken cancellationToken, Func> next); - } - - - public class NetworkClient : IAsyncDecorator - { - readonly Func> next; - readonly IAsyncDecorator[] decorators; - readonly TimeSpan timeout; - readonly IProgress progress; - readonly string basePath; - - public NetworkClient(string basePath, TimeSpan timeout, params IAsyncDecorator[] decorators) - : this(basePath, timeout, null, decorators) - { - } - - public NetworkClient(string basePath, TimeSpan timeout, IProgress progress, params IAsyncDecorator[] decorators) - { - this.next = InvokeRecursive; // setup delegate - - this.basePath = basePath; - this.timeout = timeout; - this.progress = progress; - this.decorators = new IAsyncDecorator[decorators.Length + 1]; - Array.Copy(decorators, this.decorators, decorators.Length); - this.decorators[this.decorators.Length - 1] = this; - } - - public async UniTask PostAsync(string path, T value, CancellationToken cancellationToken = default) - { - var request = new RequestContext(basePath, path, value, timeout, decorators); - var response = await InvokeRecursive(request, cancellationToken); - return response.GetResponseAs(); - } - - - UniTask InvokeRecursive(RequestContext context, CancellationToken cancellationToken) - { - return context.GetNextDecorator().SendAsync(context, cancellationToken, next); // マジカル再帰処理 - } - - async UniTask IAsyncDecorator.SendAsync(RequestContext context, CancellationToken cancellationToken, Func> _) - { - // Postしか興味ないからPostにしかしないよ! - // パフォーマンスを最大限にしたい場合はuploadHandler, downloadHandlerをカスタマイズすること - - // JSONでbodyに送るというパラメータで送るという雑設定。 - var data = JsonUtility.ToJson(context.Value); - var formData = new Dictionary { { "body", data } }; - - using (var req = UnityWebRequest.Post(basePath + context.Path, formData)) - { - var header = context.GetRawHeaders(); - if (header != null) - { - foreach (var item in header) - { - req.SetRequestHeader(item.Key, item.Value); - } - } - - // Timeout処理はCancellationTokenSourceのCancelAfterSlim(UniTask拡張)を使ってサクッと処理 - var linkToken = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); - linkToken.CancelAfterSlim(timeout); - try - { - // 完了待ちや終了処理はUniTaskの拡張自体に丸投げ - await req.SendWebRequest().ToUniTask(progress: progress, cancellationToken: linkToken.Token); - } - catch (OperationCanceledException) - { - // 元キャンセレーションソースがキャンセルしてなければTimeoutによるものと判定 - if (!cancellationToken.IsCancellationRequested) - { - throw new TimeoutException(); - } - } - finally - { - // Timeoutに引っかからなかった場合にてるのでCancelAfterSlimの裏で回ってるループをこれで終わらせとく - if (!linkToken.IsCancellationRequested) - { - linkToken.Cancel(); - } - } - - // UnityWebRequestを先にDisposeしちゃうので先に必要なものを取得しておく(性能的には無駄なのでパフォーマンスを最大限にしたい場合は更に一工夫を) - return new ResponseContext(req.downloadHandler.data, req.responseCode, req.GetResponseHeaders()); - } - } - } -} \ No newline at end of file +//using Cysharp.Threading.Tasks; +//using System; +//using System.Collections.Generic; +//using System.Diagnostics; +//using System.Linq; +//using System.Text; +//using System.Threading; +//using System.Threading.Tasks; +//using UnityEngine; +//using UnityEngine.Networking; +//using UnityEngine.SceneManagement; +//using UnityEngine.UI; + +//namespace Cysharp.Threading.Tasks.Sample +//{ +// //public class Sample2 +// //{ +// // public Sample2() +// // { +// // // デコレーターの詰まったClientを生成(これは一度作ったらフィールドに保存可) +// // var client = new NetworkClient("http://localhost", TimeSpan.FromSeconds(10), +// // new QueueRequestDecorator(), +// // new LoggingDecorator(), +// // new AppendTokenDecorator(), +// // new SetupHeaderDecorator()); + + +// // await client.PostAsync("/User/Register", new { Id = 100 }); + + +// // } +// //} + + +// public class ReturnToTitleDecorator : IAsyncDecorator +// { +// public async UniTask SendAsync(RequestContext context, CancellationToken cancellationToken, Func> next) +// { +// try +// { +// return await next(context, cancellationToken); +// } +// catch (Exception ex) +// { +// if (ex is OperationCanceledException) +// { +// // キャンセルはきっと想定されている処理なのでそのまんまスルー(呼び出し側でOperationCanceledExceptionとして飛んでいく) +// throw; +// } + +// if (ex is UnityWebRequestException uwe) +// { +// // ステータスコードを使って、タイトルに戻す例外です、とかリトライさせる例外です、とかハンドリングさせると便利 +// // if (uwe.ResponseCode) { }... +// } + +// // サーバー例外のMessageを直接出すなんて乱暴なことはデバッグ時だけですよ勿論。 +// var result = await MessageDialog.ShowAsync(ex.Message); + +// // OK か Cancelかで分岐するなら。今回はボタン一個、OKのみの想定なので無視 +// // if (result == DialogResult.Ok) { }... + +// // シーン呼び出しはawaitしないこと!awaitして正常終了しちゃうと、この通信の呼び出し元に処理が戻って続行してしまいます +// // のでForget。 +// SceneManager.LoadSceneAsync("TitleScene").ToUniTask().Forget(); + + +// // そしてOperationCanceledExceptionを投げて、この通信の呼び出し元の処理はキャンセル扱いにして終了させる +// throw new OperationCanceledException(); +// } +// } +// } + +// public enum DialogResult +// { +// Ok, +// Cancel +// } + +// public static class MessageDialog +// { +// public static async UniTask ShowAsync(string message) +// { +// // (例えば)Prefabで作っておいたダイアログを生成する +// var view = await Resources.LoadAsync("Prefabs/Dialog"); + +// // Ok, Cancelボタンのどちらかが押されるのを待機 +// return await (view as GameObject).GetComponent().ClickResult; +// } +// } + +// public class MessageDialogView : MonoBehaviour +// { +// [SerializeField] Button okButton = default; +// [SerializeField] Button closeButton = default; + +// UniTaskCompletionSource taskCompletion; + +// // これでどちらかが押されるまで無限に待つを表現 +// public UniTask ClickResult => taskCompletion.Task; + +// private void Start() +// { +// taskCompletion = new UniTaskCompletionSource(); + +// okButton.onClick.AddListener(() => +// { +// taskCompletion.TrySetResult(DialogResult.Ok); +// }); + +// closeButton.onClick.AddListener(() => +// { +// taskCompletion.TrySetResult(DialogResult.Cancel); +// }); +// } + +// // もしボタンが押されずに消滅した場合にネンノタメ。 +// private void OnDestroy() +// { +// taskCompletion.TrySetResult(DialogResult.Cancel); +// } +// } + +// public class MockDecorator : IAsyncDecorator +// { +// Dictionary mock; + +// // Pathと型を1:1にして事前定義したオブジェクトを返す辞書を渡す +// public MockDecorator(Dictionary mock) +// { +// this.mock = mock; +// } + +// public UniTask SendAsync(RequestContext context, CancellationToken cancellationToken, Func> next) +// { +// if (mock.TryGetValue(context.Path, out var value)) +// { +// // 一致したものがあればそれを返す(実際の通信は行わない) +// return new UniTask(new ResponseContext(value)); +// } +// else +// { +// return next(context, cancellationToken); +// } +// } +// } + +// //public class LoggingDecorator : IAsyncDecorator +// //{ +// // public async UniTask SendAsync(RequestContext context, CancellationToken cancellationToken, Func> next) +// // { +// // var sw = Stopwatch.StartNew(); +// // try +// // { +// // UnityEngine.Debug.Log("Start Network Request:" + context.Path); + +// // var response = await next(context, cancellationToken); + +// // 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 */ +// // } +// // } +// //} + +// public class SetupHeaderDecorator : IAsyncDecorator +// { +// public async UniTask SendAsync(RequestContext context, CancellationToken cancellationToken, Func> next) +// { +// context.RequestHeaders["x-app-timestamp"] = context.Timestamp.ToString(); +// context.RequestHeaders["x-user-id"] = "132141411"; // どこかから持ってくる +// context.RequestHeaders["x-access-token"] = "fafafawfafewaea"; // どこかから持ってくる2 + +// var respsonse = await next(context, cancellationToken); + +// var nextToken = respsonse.ResponseHeaders["token"]; +// // UserProfile.Token = nextToken; // どこかにセットするということにする + +// return respsonse; +// } +// } + + +// public class AppendTokenDecorator : IAsyncDecorator +// { +// public async UniTask SendAsync(RequestContext context, CancellationToken cancellationToken, Func> next) +// { +// string token = "token"; // どっかから取ってくるということにする +// RETRY: +// try +// { +// context.RequestHeaders["x-accesss-token"] = token; +// return await next(context, cancellationToken); +// } +// catch (UnityWebRequestException ex) +// { +// // 例えば700はTokenを再取得してください的な意味だったとする +// if (ex.ResponseCode == 700) +// { +// // 別口でTokenを取得します的な処理 +// var newToken = await new NetworkClient(context.BasePath, context.Timeout).PostAsync("/Auth/GetToken", "access_token", cancellationToken); +// context.Reset(this); +// goto RETRY; +// } + +// goto RETRY; +// } +// } +// } + +// public class QueueRequestDecorator : IAsyncDecorator +// { +// readonly Queue<(UniTaskCompletionSource, RequestContext, CancellationToken, Func>)> q = new Queue<(UniTaskCompletionSource, RequestContext, CancellationToken, Func>)>(); +// bool running; + +// public async UniTask SendAsync(RequestContext context, CancellationToken cancellationToken, Func> next) +// { +// if (q.Count == 0) +// { +// return await next(context, cancellationToken); +// } +// else +// { +// var completionSource = new UniTaskCompletionSource(); +// q.Enqueue((completionSource, context, cancellationToken, next)); +// if (!running) +// { +// Run().Forget(); +// } +// return await completionSource.Task; +// } +// } + +// async UniTaskVoid Run() +// { +// running = true; +// try +// { +// while (q.Count != 0) +// { +// var (tcs, context, cancellationToken, next) = q.Dequeue(); +// try +// { +// var response = await next(context, cancellationToken); +// tcs.TrySetResult(response); +// } +// catch (Exception ex) +// { +// tcs.TrySetException(ex); +// } +// } +// } +// finally +// { +// running = false; +// } +// } +// } + + +// public class RequestContext +// { +// int decoratorIndex; +// readonly IAsyncDecorator[] decorators; +// Dictionary headers; + +// public string BasePath { get; } +// public string Path { get; } +// public object Value { get; } +// public TimeSpan Timeout { get; } +// public DateTimeOffset Timestamp { get; private set; } + +// public IDictionary RequestHeaders +// { +// get +// { +// if (headers == null) +// { +// headers = new Dictionary(); +// } +// return headers; +// } +// } + +// public RequestContext(string basePath, string path, object value, TimeSpan timeout, IAsyncDecorator[] filters) +// { +// this.decoratorIndex = -1; +// this.decorators = filters; +// this.BasePath = basePath; +// this.Path = path; +// this.Value = value; +// this.Timeout = timeout; +// this.Timestamp = DateTimeOffset.UtcNow; +// } + +// internal Dictionary GetRawHeaders() => headers; +// internal IAsyncDecorator GetNextDecorator() => decorators[++decoratorIndex]; + +// public void Reset(IAsyncDecorator currentFilter) +// { +// decoratorIndex = Array.IndexOf(decorators, currentFilter); +// if (headers != null) +// { +// headers.Clear(); +// } +// Timestamp = DateTimeOffset.UtcNow; +// } +// } + +// public class ResponseContext +// { +// bool hasValue; +// object value; +// readonly byte[] bytes; + +// public long StatusCode { get; } +// public Dictionary ResponseHeaders { get; } + +// public ResponseContext(object value, Dictionary header = null) +// { +// this.hasValue = true; +// this.value = value; +// this.StatusCode = 200; +// this.ResponseHeaders = (header ?? new Dictionary()); +// } + +// public ResponseContext(byte[] bytes, long statusCode, Dictionary responseHeaders) +// { +// this.hasValue = false; +// this.bytes = bytes; +// this.StatusCode = statusCode; +// this.ResponseHeaders = responseHeaders; +// } + +// public byte[] GetRawData() => bytes; + +// public T GetResponseAs() +// { +// if (hasValue) +// { +// return (T)value; +// } + +// value = JsonUtility.FromJson(Encoding.UTF8.GetString(bytes)); +// hasValue = true; +// return (T)value; +// } +// } + +// public interface IAsyncDecorator +// { +// UniTask SendAsync(RequestContext context, CancellationToken cancellationToken, Func> next); +// } + + +// public class NetworkClient : IAsyncDecorator +// { +// readonly Func> next; +// readonly IAsyncDecorator[] decorators; +// readonly TimeSpan timeout; +// readonly IProgress progress; +// readonly string basePath; + +// public NetworkClient(string basePath, TimeSpan timeout, params IAsyncDecorator[] decorators) +// : this(basePath, timeout, null, decorators) +// { +// } + +// public NetworkClient(string basePath, TimeSpan timeout, IProgress progress, params IAsyncDecorator[] decorators) +// { +// this.next = InvokeRecursive; // setup delegate + +// this.basePath = basePath; +// this.timeout = timeout; +// this.progress = progress; +// this.decorators = new IAsyncDecorator[decorators.Length + 1]; +// Array.Copy(decorators, this.decorators, decorators.Length); +// this.decorators[this.decorators.Length - 1] = this; +// } + +// public async UniTask PostAsync(string path, T value, CancellationToken cancellationToken = default) +// { +// var request = new RequestContext(basePath, path, value, timeout, decorators); +// var response = await InvokeRecursive(request, cancellationToken); +// return response.GetResponseAs(); +// } + + +// UniTask InvokeRecursive(RequestContext context, CancellationToken cancellationToken) +// { +// return context.GetNextDecorator().SendAsync(context, cancellationToken, next); // マジカル再帰処理 +// } + +// async UniTask IAsyncDecorator.SendAsync(RequestContext context, CancellationToken cancellationToken, Func> _) +// { +// // Postしか興味ないからPostにしかしないよ! +// // パフォーマンスを最大限にしたい場合はuploadHandler, downloadHandlerをカスタマイズすること + +// // JSONでbodyに送るというパラメータで送るという雑設定。 +// var data = JsonUtility.ToJson(context.Value); +// var formData = new Dictionary { { "body", data } }; + +// using (var req = UnityWebRequest.Post(basePath + context.Path, formData)) +// { +// var header = context.GetRawHeaders(); +// if (header != null) +// { +// foreach (var item in header) +// { +// req.SetRequestHeader(item.Key, item.Value); +// } +// } + +// // Timeout処理はCancellationTokenSourceのCancelAfterSlim(UniTask拡張)を使ってサクッと処理 +// var linkToken = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); +// linkToken.CancelAfterSlim(timeout); +// try +// { +// // 完了待ちや終了処理はUniTaskの拡張自体に丸投げ +// await req.SendWebRequest().ToUniTask(progress: progress, cancellationToken: linkToken.Token); +// } +// catch (OperationCanceledException) +// { +// // 元キャンセレーションソースがキャンセルしてなければTimeoutによるものと判定 +// if (!cancellationToken.IsCancellationRequested) +// { +// throw new TimeoutException(); +// } +// } +// finally +// { +// // Timeoutに引っかからなかった場合にてるのでCancelAfterSlimの裏で回ってるループをこれで終わらせとく +// if (!linkToken.IsCancellationRequested) +// { +// linkToken.Cancel(); +// } +// } + +// // UnityWebRequestを先にDisposeしちゃうので先に必要なものを取得しておく(性能的には無駄なのでパフォーマンスを最大限にしたい場合は更に一工夫を) +// return new ResponseContext(req.downloadHandler.data, req.responseCode, req.GetResponseHeaders()); +// } +// } +// } +//} \ No newline at end of file diff --git a/src/UniTask/Assets/Scenes/SandboxMain.cs b/src/UniTask/Assets/Scenes/SandboxMain.cs index 3077e05..516f7f9 100644 --- a/src/UniTask/Assets/Scenes/SandboxMain.cs +++ b/src/UniTask/Assets/Scenes/SandboxMain.cs @@ -18,7 +18,6 @@ using UnityEngine.SceneManagement; using UnityEngine.Rendering; using System.IO; using System.Linq.Expressions; -using Cysharp.Threading.Tasks.Sample; // using DG.Tweening; @@ -269,32 +268,33 @@ public class SandboxMain : MonoBehaviour async Task Test1() { - var r = await TcsAsync("https://bing.com/"); + // var r = await TcsAsync("https://bing.com/"); + await Task.Yield(); Debug.Log("TASKASYNC"); } - async UniTaskVoid Test2() - { - try - { - //var cts = new CancellationTokenSource(); - //var r = UniAsync("https://bing.com/", cts.Token); - //cts.Cancel(); - //await r; - Debug.Log("SendWebRequestDone:" + PlayerLoopInfo.CurrentLoopType); + //async UniTaskVoid Test2() + //{ + // try + // { + // //var cts = new CancellationTokenSource(); + // //var r = UniAsync("https://bing.com/", cts.Token); + // //cts.Cancel(); + // //await r; + // Debug.Log("SendWebRequestDone:" + PlayerLoopInfo.CurrentLoopType); - // var foo = await UnityWebRequest.Get("https://bing.com/").SendWebRequest(); - // foo.downloadHandler.text; - // - _ = await UnityWebRequest.Get("https://bing.com/").SendWebRequest().WithCancellation(CancellationToken.None); - Debug.Log("SendWebRequestWithCancellationDone:" + PlayerLoopInfo.CurrentLoopType); - } - catch - { - Debug.Log("Canceled"); - } - } + // // var foo = await UnityWebRequest.Get("https://bing.com/").SendWebRequest(); + // // foo.downloadHandler.text; + // // + // _ = await UnityWebRequest.Get("https://bing.com/").SendWebRequest().WithCancellation(CancellationToken.None); + // Debug.Log("SendWebRequestWithCancellationDone:" + PlayerLoopInfo.CurrentLoopType); + // } + // catch + // { + // Debug.Log("Canceled"); + // } + //} IEnumerator Test3(string url) { @@ -303,17 +303,17 @@ public class SandboxMain : MonoBehaviour Debug.Log("COROUTINE"); } - static async Task TcsAsync(string url) - { - var req = await UnityWebRequest.Get(url).SendWebRequest(); - return req; - } + //static async Task TcsAsync(string url) + //{ + // var req = await UnityWebRequest.Get(url).SendWebRequest(); + // return req; + //} - static async UniTask UniAsync(string url, CancellationToken cancellationToken) - { - var req = await UnityWebRequest.Get(url).SendWebRequest().WithCancellation(cancellationToken); - return req; - } + //static async UniTask UniAsync(string url, CancellationToken cancellationToken) + //{ + // var req = await UnityWebRequest.Get(url).SendWebRequest().WithCancellation(cancellationToken); + // return req; + //} async Task Test() { diff --git a/src/UniTask/Assets/TempAsm/FooMonoBehaviour.cs b/src/UniTask/Assets/TempAsm/FooMonoBehaviour.cs index c57b11e..6c62ccb 100644 --- a/src/UniTask/Assets/TempAsm/FooMonoBehaviour.cs +++ b/src/UniTask/Assets/TempAsm/FooMonoBehaviour.cs @@ -14,14 +14,14 @@ public class FooMonoBehaviour : MonoBehaviour private async UniTask Download(UnityWebRequest req, string filePath) { - var foo = req.SendWebRequest(); + _ = req.SendWebRequest(); - - var aaa = await foo; - Debug.Log(aaa); + // var aaa = await foo; + // Debug.Log(aaa); + await UniTask.Yield(); //File.WriteAllText(filePath, req.downloadHandler.text ?? string.Empty); } } diff --git a/src/UniTask/ProjectSettings/ProjectVersion.txt b/src/UniTask/ProjectSettings/ProjectVersion.txt index a328ffd..0560e11 100644 --- a/src/UniTask/ProjectSettings/ProjectVersion.txt +++ b/src/UniTask/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2020.2.1f1 -m_EditorVersionWithRevision: 2020.2.1f1 (270dd8c3da1c) +m_EditorVersion: 2020.2.0f1 +m_EditorVersionWithRevision: 2020.2.0f1 (3721df5a8b28)