├── ProjectSettings ├── boot.config ├── ProjectVersion.txt ├── ClusterInputManager.asset ├── PresetManager.asset ├── EditorBuildSettings.asset ├── XRSettings.asset ├── VersionControlSettings.asset ├── TimeManager.asset ├── VFXManager.asset ├── AudioManager.asset ├── TagManager.asset ├── UnityConnectSettings.asset ├── DynamicsManager.asset ├── MemorySettings.asset ├── PackageManagerSettings.asset ├── EditorSettings.asset ├── NavMeshAreas.asset ├── Physics2DSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── QualitySettings.asset └── ProjectSettings.asset ├── Assets ├── Plugins │ ├── UniTask Supplement │ │ ├── UniTask │ │ │ ├── UniTask.asmref │ │ │ ├── Scripts │ │ │ │ ├── UniTask.Delay.cs.meta │ │ │ │ ├── UniTask.WhenAny.cs.meta │ │ │ │ ├── UniTask.WhenAny.Generated.tt.meta │ │ │ │ ├── UniTask.WaitUntil.cs.meta │ │ │ │ ├── UniTask.WhenAny.Generated.cs.meta │ │ │ │ ├── UniTask.WhenAny.cs │ │ │ │ ├── UniTask.WaitUntil.cs │ │ │ │ ├── UniTask.Delay.cs │ │ │ │ ├── UniTask.WhenAny.Generated.tt │ │ │ │ └── UniTask.WhenAny.Generated.cs │ │ │ ├── Scripts.meta │ │ │ └── UniTask.asmref.meta │ │ ├── UniTask.DOTween │ │ │ ├── UniTask.DOTween.asmref │ │ │ ├── Scripts │ │ │ │ ├── DOTweenAsyncExtensions.Supplement.cs.meta │ │ │ │ ├── DOTweenAsyncExtensions.cs.meta │ │ │ │ ├── DOTweenAsyncExtensions.Supplement.cs │ │ │ │ └── DOTweenAsyncExtensions.cs │ │ │ ├── Scripts.meta │ │ │ └── UniTask.DOTween.asmref.meta │ │ ├── package.json.meta │ │ ├── UniTask.meta │ │ ├── UniTask.DOTween.meta │ │ └── package.json │ └── UniTask Supplement.meta ├── Plugins.meta ├── Scenes.meta └── Scenes │ ├── SampleScene.unity.meta │ └── SampleScene.unity ├── README.md.meta ├── LICENSE ├── .gitignore ├── .github └── workflows │ └── release.yml ├── Packages ├── manifest.json └── packages-lock.json ├── README.md └── UniTask-Supplement.sln.DotSettings /ProjectSettings/boot.config: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask/UniTask.asmref: -------------------------------------------------------------------------------- 1 | { 2 | "reference": "GUID:f51ebe6a0ceec4240a699833d6309b23" 3 | } -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.2.0f1 2 | m_EditorVersionWithRevision: 2021.2.0f1 (4bf1ec4b23c9) 3 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask.DOTween/UniTask.DOTween.asmref: -------------------------------------------------------------------------------- 1 | { 2 | "reference": "GUID:029c1c1b674aaae47a6841a0b89ad80e" 3 | } -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask/Scripts/UniTask.Delay.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee7cd9a8b01a4d0289b245427f3e5a38 3 | timeCreated: 1677161380 -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask/Scripts/UniTask.WhenAny.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef351bf5b18e4d779a7f6270be0cdbfb 3 | timeCreated: 1677248088 -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask/Scripts/UniTask.WhenAny.Generated.tt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1ae2ccd5de44af0bedb95f64b8fc7b1 3 | timeCreated: 1677252444 -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask.DOTween/Scripts/DOTweenAsyncExtensions.Supplement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ac1a2b28b764b69b4ec5ba8e0336301 3 | timeCreated: 1677420091 -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35d4ee571a11843288841b412d9462d4 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22a63760cd54e42cc887b94d0cca63a0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba17f5c4740974ebfbe2094ccdbc69fd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc0d4010bbf28b4594072e72b8655ab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77305bfe9c8a44837a6128a8e1899d95 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d59c9a556a1954c00b9e7c315400547c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 20d05ec815d07495695ec7263161c96d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask.DOTween.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32e7f65c0d77740a5b29198a8df4eacb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b264371eb68c493e931b4d70e0428a0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask.DOTween/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f45753feaa384885af808d6b6299dc3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask/UniTask.asmref.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eaf2397d3ebe949bbb0c0b348115fd6a 3 | AssemblyDefinitionReferenceImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask.DOTween/UniTask.DOTween.asmref.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a2cb2aa5e8dd4f88a32afb5c25cfc81 3 | AssemblyDefinitionReferenceImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask/Scripts/UniTask.WaitUntil.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4674f2bc4803479aa1a466a7556fe03 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask/Scripts/UniTask.WhenAny.Generated.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7590405fd6731455a88aa08ab8141e8c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask.DOTween/Scripts/DOTweenAsyncExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56aa21173a6e9499f989ce004b601b69 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.jagapippi.unitask-supplement", 3 | "version": "1.1.2", 4 | "displayName": "UniTask Supplement", 5 | "description": "Supplemental codes for UniTask.", 6 | "unity": "2018.4", 7 | "author": { 8 | "name": "su10", 9 | "url": "https://github.com/su10" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/su10/UniTask-Supplement" 14 | }, 15 | "dependencies": { 16 | "com.cysharp.unitask": "2.0.21" 17 | }, 18 | "keywords": [ 19 | "unitask" 20 | ], 21 | "license": "MIT", 22 | "licensesUrl": "https://github.com/su10/UniTask-Supplement/blob/main/LICENSE.md" 23 | } -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | UnityAdsSettings: 27 | m_Enabled: 0 28 | m_InitializeOnStartup: 1 29 | m_TestMode: 0 30 | m_IosGameId: 31 | m_AndroidGameId: 32 | m_GameIds: {} 33 | m_GameId: 34 | PerformanceReportingSettings: 35 | m_Enabled: 0 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 su10 4 | Copyright (c) 2019 Yoshifumi Kawai / Cysharp, Inc. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask/Scripts/UniTask.WhenAny.cs: -------------------------------------------------------------------------------- 1 | #if !UNITASK_SUPPLEMENT_DISABLE_WHEN_ANY 2 | using System; 3 | using System.Threading; 4 | 5 | namespace Cysharp.Threading.Tasks 6 | { 7 | public partial struct UniTask 8 | { 9 | public static async UniTask<(bool hasResultLeft, T result)> WhenAny(Func> leftTaskFunc, Func rightTaskFunc, CancellationToken cancellationToken) 10 | { 11 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 12 | (bool hasResultLeft, T result) result; 13 | 14 | try 15 | { 16 | result = await WhenAny(leftTaskFunc(cts.Token), rightTaskFunc(cts.Token)); 17 | cts.Cancel(); 18 | } 19 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 20 | { 21 | if (cancellationToken.IsCancellationRequested) 22 | { 23 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 24 | } 25 | 26 | throw; 27 | } 28 | finally 29 | { 30 | cts.Dispose(); 31 | } 32 | 33 | return result; 34 | } 35 | } 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | m_SeeAllPackageVersions: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | - m_Id: scoped:package.openupm.com 29 | m_Name: package.openupm.com 30 | m_Url: https://package.openupm.com 31 | m_Scopes: 32 | - com.cysharp.unitask 33 | - com.openupm 34 | m_IsDefault: 0 35 | m_Capabilities: 0 36 | m_UserSelectedRegistryName: package.openupm.com 37 | m_UserAddingNewScopedRegistry: 0 38 | m_RegistryInfoDraft: 39 | m_Modified: 0 40 | m_ErrorMessage: 41 | m_UserModificationsInstanceId: -822 42 | m_OriginalInstanceId: -824 43 | m_LoadAssets: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_SerializationMode: 2 8 | m_LineEndingsForNewScripts: 0 9 | m_DefaultBehaviorMode: 0 10 | m_PrefabRegularEnvironment: {fileID: 0} 11 | m_PrefabUIEnvironment: {fileID: 0} 12 | m_SpritePackerMode: 0 13 | m_SpritePackerPaddingPower: 1 14 | m_Bc7TextureCompressor: 0 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_EnableTextureStreamingInEditMode: 1 22 | m_EnableTextureStreamingInPlayMode: 1 23 | m_AsyncShaderCompilation: 1 24 | m_CachingShaderPreprocessor: 1 25 | m_PrefabModeAllowAutoSave: 1 26 | m_EnterPlayModeOptionsEnabled: 1 27 | m_EnterPlayModeOptions: 3 28 | m_GameObjectNamingDigits: 1 29 | m_GameObjectNamingScheme: 0 30 | m_AssetNamingUsesSpace: 1 31 | m_UseLegacyProbeSampleCount: 0 32 | m_SerializeInlineMappingsOnOneLine: 1 33 | m_DisableCookiesInLightmapper: 0 34 | m_AssetPipelineMode: 1 35 | m_RefreshImportMode: 0 36 | m_CacheServerMode: 0 37 | m_CacheServerEndpoint: 38 | m_CacheServerNamespacePrefix: default 39 | m_CacheServerEnableDownload: 1 40 | m_CacheServerEnableUpload: 1 41 | m_CacheServerEnableAuth: 0 42 | m_CacheServerEnableTls: 0 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Uu]ser[Ss]ettings/ 12 | 13 | # MemoryCaptures can get excessive in size. 14 | # They also could contain extremely sensitive data 15 | /[Mm]emoryCaptures/ 16 | 17 | # Recordings can get excessive in size 18 | /[Rr]ecordings/ 19 | 20 | # Uncomment this line if you wish to ignore the asset store tools plugin 21 | # /[Aa]ssets/AssetStoreTools* 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | /[Aa]ssets/Plugins/Editor/JetBrains* 25 | .idea/ 26 | 27 | # Visual Studio cache directory 28 | .vs/ 29 | 30 | # Gradle cache directory 31 | .gradle/ 32 | 33 | # Autogenerated VS/MD/Consulo solution and project files 34 | ExportedObj/ 35 | .consulo/ 36 | *.csproj 37 | *.unityproj 38 | *.sln 39 | *.suo 40 | *.tmp 41 | *.user 42 | *.userprefs 43 | *.pidb 44 | *.booproj 45 | *.svd 46 | *.pdb 47 | *.mdb 48 | *.opendb 49 | *.VC.db 50 | 51 | # Unity3D generated meta files 52 | *.pidb.meta 53 | *.pdb.meta 54 | *.mdb.meta 55 | 56 | # Unity3D generated file on crash reports 57 | sysinfo.txt 58 | 59 | # Builds 60 | *.ipa 61 | *.apk 62 | *.aab 63 | # *.unitypackage 64 | *.app 65 | 66 | # Crashlytics generated file 67 | crashlytics-build.properties 68 | 69 | # Packed Addressables 70 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 71 | 72 | # Temporary auto-generated Android Assets 73 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 74 | /[Aa]ssets/[Ss]treamingAssets/aa/* 75 | 76 | # macOS generated file 77 | .DS_Store 78 | 79 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | tags: 6 | - "v[0-9]+.[0-9]+.[0-9]+" 7 | 8 | env: 9 | BRANCH_MAIN: main 10 | BRANCH_UPM: upm 11 | GIT_TAG: ${{ github.event.inputs.tag }} 12 | PACKAGE_ROOT: Assets/Plugins/UniTask Supplement 13 | DOC_FILES: README.md CHANGELOG.md LICENSE.md 14 | 15 | jobs: 16 | create-upm-branches: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v3 21 | with: 22 | fetch-depth: 0 23 | - run: git checkout main 24 | 25 | - name: Configure git 26 | run: | 27 | git config --local user.name "github-actions[bot]" 28 | git config --local user.email "github-actions[bot]@users.noreply.github.com" 29 | 30 | - name: Set tag name 31 | id: tag 32 | run: echo "name=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT 33 | 34 | - name: Create UPM branches 35 | run: | 36 | git branch -D $BRANCH_UPM &> /dev/null || echo $BRANCH_UPM branch was not found 37 | git subtree split -P "$PACKAGE_ROOT" -b $BRANCH_UPM 38 | git checkout $BRANCH_UPM 39 | for file in $DOC_FILES; do 40 | git checkout $BRANCH_MAIN $file ${file}.meta &> /dev/null || echo $file was not found 41 | done 42 | sed -i -e "s/\"version\":.*$/\"version\": \"${TAG_NAME#v}\",/" "Assets/Plugins/UniTask Supplement/package.json" || echo package.json was not found 43 | git commit -am "release $TAG_NAME." 44 | git push -f origin $BRANCH_UPM 45 | git tag $BRANCH_UPM/$TAG_NAME 46 | git push -f origin $BRANCH_UPM/$TAG_NAME 47 | env: 48 | TAG_NAME: ${{ steps.tag.outputs.name }} 49 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask/Scripts/UniTask.WaitUntil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading; 4 | 5 | namespace Cysharp.Threading.Tasks 6 | { 7 | public partial struct UniTask 8 | { 9 | public static UniTask WaitUntil(Func predicate, CancellationToken cancellationToken) 10 | { 11 | return WaitUntil(predicate, PlayerLoopTiming.Update, cancellationToken); 12 | } 13 | 14 | public static UniTask WaitWhile(Func predicate, CancellationToken cancellationToken) 15 | { 16 | return WaitWhile(predicate, PlayerLoopTiming.Update, cancellationToken); 17 | } 18 | 19 | public static UniTask WaitUntilValueChanged(T target, Func monitorFunction, CancellationToken cancellationToken) 20 | where T : class 21 | { 22 | return WaitUntilValueChanged(target, monitorFunction, PlayerLoopTiming.Update, null, cancellationToken); 23 | } 24 | 25 | public static UniTask WaitUntilValueChanged(T target, Func monitorFunction, PlayerLoopTiming monitorTiming, CancellationToken cancellationToken) 26 | where T : class 27 | { 28 | return WaitUntilValueChanged(target, monitorFunction, monitorTiming, null, cancellationToken); 29 | } 30 | 31 | public static UniTask WaitUntilValueChanged(T target, Func monitorFunction, IEqualityComparer equalityComparer, CancellationToken cancellationToken) 32 | where T : class 33 | { 34 | return WaitUntilValueChanged(target, monitorFunction, PlayerLoopTiming.Update, equalityComparer, cancellationToken); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask.DOTween/Scripts/DOTweenAsyncExtensions.Supplement.cs: -------------------------------------------------------------------------------- 1 | #if UNITASK_SUPPLEMENT_DOTWEEN_SUPPORT 2 | using System.Threading; 3 | using DG.Tweening; 4 | 5 | namespace Cysharp.Threading.Tasks 6 | { 7 | public static partial class DOTweenAsyncExtensions 8 | { 9 | private const TweenCancelBehaviour DefaultTweenCancelBehaviour = 10 | #if UNITASK_SUPPLEMENT_DOTWEEN_SUPPORT_USE_ORIGINAL_DEFAULT_TWEEN_CANCEL_BEHAVIOUR 11 | TweenCancelBehaviour.Kill; 12 | #else 13 | TweenCancelBehaviour.KillAndCancelAwait; 14 | #endif 15 | 16 | public static UniTask ToUniTask(this Tween tween, CancellationToken cancellationToken) 17 | { 18 | return ToUniTask(tween, DefaultTweenCancelBehaviour, cancellationToken); 19 | } 20 | 21 | public static UniTask AwaitForComplete(this Tween tween, CancellationToken cancellationToken) 22 | { 23 | return AwaitForComplete(tween, DefaultTweenCancelBehaviour, cancellationToken); 24 | } 25 | 26 | public static UniTask AwaitForPause(this Tween tween, CancellationToken cancellationToken) 27 | { 28 | return AwaitForPause(tween, DefaultTweenCancelBehaviour, cancellationToken); 29 | } 30 | 31 | public static UniTask AwaitForPlay(this Tween tween, CancellationToken cancellationToken) 32 | { 33 | return AwaitForPlay(tween, DefaultTweenCancelBehaviour, cancellationToken); 34 | } 35 | 36 | public static UniTask AwaitForRewind(this Tween tween, CancellationToken cancellationToken) 37 | { 38 | return AwaitForRewind(tween, DefaultTweenCancelBehaviour, cancellationToken); 39 | } 40 | 41 | public static UniTask AwaitForStepComplete(this Tween tween, CancellationToken cancellationToken) 42 | { 43 | return AwaitForStepComplete(tween, DefaultTweenCancelBehaviour, cancellationToken); 44 | } 45 | } 46 | } 47 | #endif 48 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.cysharp.unitask": "2.3.3", 4 | "com.unity.ide.rider": "3.0.18", 5 | "com.unity.ide.visualstudio": "2.0.17", 6 | "com.unity.ide.vscode": "1.2.5", 7 | "com.unity.test-framework": "1.3.3", 8 | "com.unity.ugui": "1.0.0", 9 | "com.unity.modules.ai": "1.0.0", 10 | "com.unity.modules.androidjni": "1.0.0", 11 | "com.unity.modules.animation": "1.0.0", 12 | "com.unity.modules.assetbundle": "1.0.0", 13 | "com.unity.modules.audio": "1.0.0", 14 | "com.unity.modules.cloth": "1.0.0", 15 | "com.unity.modules.director": "1.0.0", 16 | "com.unity.modules.imageconversion": "1.0.0", 17 | "com.unity.modules.imgui": "1.0.0", 18 | "com.unity.modules.jsonserialize": "1.0.0", 19 | "com.unity.modules.particlesystem": "1.0.0", 20 | "com.unity.modules.physics": "1.0.0", 21 | "com.unity.modules.physics2d": "1.0.0", 22 | "com.unity.modules.screencapture": "1.0.0", 23 | "com.unity.modules.terrain": "1.0.0", 24 | "com.unity.modules.terrainphysics": "1.0.0", 25 | "com.unity.modules.tilemap": "1.0.0", 26 | "com.unity.modules.ui": "1.0.0", 27 | "com.unity.modules.uielements": "1.0.0", 28 | "com.unity.modules.umbra": "1.0.0", 29 | "com.unity.modules.unityanalytics": "1.0.0", 30 | "com.unity.modules.unitywebrequest": "1.0.0", 31 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 32 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 33 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 34 | "com.unity.modules.unitywebrequestwww": "1.0.0", 35 | "com.unity.modules.vehicles": "1.0.0", 36 | "com.unity.modules.video": "1.0.0", 37 | "com.unity.modules.vr": "1.0.0", 38 | "com.unity.modules.wind": "1.0.0", 39 | "com.unity.modules.xr": "1.0.0" 40 | }, 41 | "scopedRegistries": [ 42 | { 43 | "name": "package.openupm.com", 44 | "url": "https://package.openupm.com", 45 | "scopes": [ 46 | "com.cysharp.unitask", 47 | "com.openupm" 48 | ] 49 | } 50 | ] 51 | } 52 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask/Scripts/UniTask.Delay.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | 4 | namespace Cysharp.Threading.Tasks 5 | { 6 | public partial struct UniTask 7 | { 8 | public static UniTask DelayFrame(int delayFrameCount, CancellationToken cancellationToken) 9 | { 10 | return DelayFrame(delayFrameCount, PlayerLoopTiming.Update, cancellationToken); 11 | } 12 | 13 | public static UniTask Delay(int millisecondsDelay, CancellationToken cancellationToken) 14 | { 15 | return Delay(millisecondsDelay, false, PlayerLoopTiming.Update, cancellationToken); 16 | } 17 | 18 | public static UniTask Delay(int millisecondsDelay, bool ignoreTimeScale, CancellationToken cancellationToken) 19 | { 20 | return Delay(millisecondsDelay, ignoreTimeScale, PlayerLoopTiming.Update, cancellationToken); 21 | } 22 | 23 | public static UniTask Delay(TimeSpan delayTimeSpan, CancellationToken cancellationToken) 24 | { 25 | return Delay(delayTimeSpan, false, PlayerLoopTiming.Update, cancellationToken); 26 | } 27 | 28 | public static UniTask Delay(TimeSpan delayTimeSpan, bool ignoreTimeScale, CancellationToken cancellationToken) 29 | { 30 | return Delay(delayTimeSpan, ignoreTimeScale, PlayerLoopTiming.Update, cancellationToken); 31 | } 32 | 33 | public static UniTask Delay(int millisecondsDelay, DelayType delayType, CancellationToken cancellationToken) 34 | { 35 | return Delay(millisecondsDelay, delayType, PlayerLoopTiming.Update, cancellationToken); 36 | } 37 | 38 | public static UniTask Delay(TimeSpan delayTimeSpan, DelayType delayType, CancellationToken cancellationToken) 39 | { 40 | return Delay(delayTimeSpan, delayType, PlayerLoopTiming.Update, cancellationToken); 41 | } 42 | 43 | #if !UNITASK_SUPPLEMENT_DISABLE_DELAY_MILLISECONDS 44 | public static UniTask DelayMilliseconds(int millisecondsDelay, CancellationToken cancellationToken) 45 | { 46 | return Delay(millisecondsDelay, false, PlayerLoopTiming.Update, cancellationToken); 47 | } 48 | 49 | public static UniTask DelayMilliseconds(int millisecondsDelay, bool ignoreTimeScale, CancellationToken cancellationToken) 50 | { 51 | return Delay(millisecondsDelay, ignoreTimeScale, PlayerLoopTiming.Update, cancellationToken); 52 | } 53 | 54 | public static UniTask DelayMilliseconds(int millisecondsDelay, bool ignoreTimeScale, PlayerLoopTiming delayTiming, CancellationToken cancellationToken) 55 | { 56 | return Delay(millisecondsDelay, ignoreTimeScale, delayTiming, cancellationToken); 57 | } 58 | 59 | public static UniTask DelayMilliseconds(int millisecondsDelay, DelayType delayType, CancellationToken cancellationToken) 60 | { 61 | return Delay(millisecondsDelay, delayType, PlayerLoopTiming.Update, cancellationToken); 62 | } 63 | 64 | public static UniTask DelayMilliseconds(int millisecondsDelay, DelayType delayType, PlayerLoopTiming delayTiming, CancellationToken cancellationToken) 65 | { 66 | return Delay(millisecondsDelay, delayType, delayTiming, cancellationToken); 67 | } 68 | #endif 69 | 70 | #if !UNITASK_SUPPLEMENT_DISABLE_DELAY_SECONDS 71 | public static UniTask DelaySeconds(float secondsDelay, CancellationToken cancellationToken) 72 | { 73 | return Delay(TimeSpan.FromSeconds(secondsDelay), false, PlayerLoopTiming.Update, cancellationToken); 74 | } 75 | 76 | public static UniTask DelaySeconds(float secondsDelay, bool ignoreTimeScale, CancellationToken cancellationToken) 77 | { 78 | return Delay(TimeSpan.FromSeconds(secondsDelay), ignoreTimeScale, PlayerLoopTiming.Update, cancellationToken); 79 | } 80 | 81 | public static UniTask DelaySeconds(float secondsDelay, bool ignoreTimeScale, PlayerLoopTiming delayTiming, CancellationToken cancellationToken) 82 | { 83 | return Delay(TimeSpan.FromSeconds(secondsDelay), ignoreTimeScale, delayTiming, cancellationToken); 84 | } 85 | 86 | public static UniTask DelaySeconds(float secondsDelay, DelayType delayType, CancellationToken cancellationToken) 87 | { 88 | return Delay(TimeSpan.FromSeconds(secondsDelay), delayType, PlayerLoopTiming.Update, cancellationToken); 89 | } 90 | 91 | public static UniTask DelaySeconds(float secondsDelay, DelayType delayType, PlayerLoopTiming delayTiming, CancellationToken cancellationToken) 92 | { 93 | return Delay(TimeSpan.FromSeconds(secondsDelay), delayType, delayTiming, cancellationToken); 94 | } 95 | #endif 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask/Scripts/UniTask.WhenAny.Generated.tt: -------------------------------------------------------------------------------- 1 | <#@ template language="C#" #> 2 | <#@ import namespace="System.Linq" #> 3 | #if !UNITASK_SUPPLEMENT_DISABLE_WHEN_ANY 4 | using System; 5 | using System.Runtime.CompilerServices; 6 | using System.Runtime.ExceptionServices; 7 | using System.Threading; 8 | using Cysharp.Threading.Tasks.Internal; 9 | 10 | namespace Cysharp.Threading.Tasks 11 | { 12 | public partial struct UniTask 13 | { 14 | <# const int methodCount = 15; #> 15 | <# for (var i = 2; i <= methodCount; i++) { #> 16 | public static async UniTask<(int winArgumentIndex, T result)> WhenAny( 17 | <# for (var j = 1; j <= i; j++) { #> 18 | Func> taskFunc<#= j #>, 19 | <# } #> 20 | CancellationToken cancellationToken 21 | ) 22 | { 23 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 24 | (int winArgumentIndex, T result) result = default; 25 | 26 | try 27 | { 28 | result = await WhenAny( 29 | <# for (var j = 1; j <= i; j++) { #> 30 | taskFunc<#= j #>(cts.Token)<#= (j < i) ? "," : "" #> 31 | <# } #> 32 | ); 33 | 34 | cts.Cancel(); 35 | } 36 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 37 | { 38 | if (cancellationToken.IsCancellationRequested) 39 | { 40 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 41 | } 42 | 43 | throw; 44 | } 45 | finally 46 | { 47 | cts.Dispose(); 48 | } 49 | 50 | return result; 51 | } 52 | 53 | <# } #> 54 | <# for (var i = 2; i <= methodCount; i++) { #> 55 | /// Return value is winArgumentIndex 56 | public static async UniTask WhenAny( 57 | <# for (var j = 1; j <= i; j++) { #> 58 | Func taskFunc<#= j #>, 59 | <# } #> 60 | CancellationToken cancellationToken 61 | ) 62 | { 63 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 64 | int winArgumentIndex = default; 65 | 66 | try 67 | { 68 | winArgumentIndex = await WhenAny( 69 | <# for (var j = 1; j <= i; j++) { #> 70 | taskFunc<#= j #>(cts.Token)<#= (j < i) ? "," : "" #> 71 | <# } #> 72 | ); 73 | 74 | cts.Cancel(); 75 | } 76 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 77 | { 78 | if (cancellationToken.IsCancellationRequested) 79 | { 80 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 81 | } 82 | 83 | throw; 84 | } 85 | finally 86 | { 87 | cts.Dispose(); 88 | } 89 | 90 | return winArgumentIndex; 91 | } 92 | 93 | <# } #> 94 | <# for (var i = 2; i <= methodCount; i++) { #> 95 | public static async UniTask<(int winArgumentIndex, <# Write(string.Join(", ", Enumerable.Range(1, i).Select(j => $"T{j} result{j}"))); #>)> WhenAny<<# Write(string.Join(", ", Enumerable.Range(1, i).Select(j => $"T{j}"))); #>>(<# Write(string.Join(", ", Enumerable.Range(1, i).Select(j => $"Func> taskFunc{j}"))); #>, CancellationToken cancellationToken) 96 | { 97 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 98 | (int winArgumentIndex, <# Write(string.Join(", ", Enumerable.Range(1, i).Select(j => $"T{j} result{j}"))); #>) result = default; 99 | 100 | try 101 | { 102 | result = await WhenAny<<# Write(string.Join(", ", Enumerable.Range(1, i).Select(j => $"T{j}"))); #>>( 103 | <# for (var j = 1; j <= i; j++) { #> 104 | taskFunc<#= j #>(cts.Token)<#= (j < i) ? "," : "" #> 105 | <# } #> 106 | ); 107 | 108 | cts.Cancel(); 109 | } 110 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 111 | { 112 | if (cancellationToken.IsCancellationRequested) 113 | { 114 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 115 | } 116 | 117 | throw; 118 | } 119 | finally 120 | { 121 | cts.Dispose(); 122 | } 123 | 124 | return result; 125 | } 126 | <# if (i < methodCount) WriteLine(""); #> 127 | <# } #> 128 | } 129 | } 130 | #endif 131 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Lumin: 5 222 | Nintendo 3DS: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | PSP2: 2 226 | Stadia: 5 227 | Standalone: 5 228 | WebGL: 3 229 | Windows Store Apps: 5 230 | XboxOne: 5 231 | iPhone: 2 232 | tvOS: 2 233 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UniTask Supplement 2 | Supplemental codes for UniTask. 3 | 4 | Mainly adds shorthand methods that do not require `cancellationToken:`. 5 | 6 | ## Features 7 | ### `Delay***()` Shorthands & Aliases 8 | ```csharp 9 | // UniTask 10 | await UniTask.DelayFrame(5, cancellationToken: cancellationToken); 11 | 12 | // with UniTask Supplement 13 | await UniTask.DelayFrame(5, cancellationToken); 14 | ``` 15 | 16 | ```csharp 17 | // UniTask 18 | await UniTask.Delay(500, cancellationToken: cancellationToken); 19 | 20 | // with UniTask Supplement 21 | await UniTask.Delay(500, cancellationToken); 22 | ``` 23 | 24 | ```csharp 25 | // UniTask 26 | await UniTask.Delay(TimeSpan.FromMilliseconds(500), cancellationToken: cancellationToken); 27 | 28 | // with UniTask Supplement 29 | await UniTask.Delay(TimeSpan.FromMilliseconds(500), cancellationToken); 30 | ``` 31 | 32 | ```csharp 33 | // UniTask 34 | await UniTask.Delay(500, cancellationToken: cancellationToken); 35 | 36 | // with UniTask Supplement 37 | await UniTask.DelayMilliseconds(500, cancellationToken); 38 | ``` 39 | 40 | You can disable `DelayMilliseconds()` to define `UNITASK_SUPPLEMENT_DISABLE_DELAY_MILLISECONDS`. 41 | 42 | ```csharp 43 | // UniTask 44 | await UniTask.Delay(1500, cancellationToken: cancellationToken); 45 | await UniTask.Delay(TimeSpan.FromSeconds(1.5f), cancellationToken: cancellationToken); 46 | 47 | // with UniTask Supplement 48 | await UniTask.DelaySeconds(1.5f, cancellationToken); 49 | ``` 50 | 51 | You can disable `DelaySeconds()` to define `UNITASK_SUPPLEMENT_DISABLE_DELAY_SECONDS`. 52 | 53 | ### `Wait***()` Shorthands 54 | ```csharp 55 | // UniTask 56 | await UniTask.WaitUntil(() => flag, cancellationToken: cancellationToken); 57 | 58 | // with UniTask Supplement 59 | await UniTask.WaitUntil(() => flag, cancellationToken); 60 | ``` 61 | 62 | ```csharp 63 | // UniTask 64 | await UniTask.WaitWhile(() => flag, cancellationToken: cancellationToken); 65 | 66 | // with UniTask Supplement 67 | await UniTask.WaitWhile(() => flag, cancellationToken); 68 | ``` 69 | 70 | ```csharp 71 | // UniTask 72 | await UniTask.WaitUntilValueChanged(transform, x => x.position, cancellationToken: cancellationToken); 73 | 74 | // with UniTask Supplement 75 | await UniTask.WaitUntilValueChanged(transform, x => x.position, cancellationToken); 76 | ``` 77 | 78 | ### `WhenAny(.., cancellationToken)` Shorthands 79 | ```csharp 80 | // UniTask 81 | { 82 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 83 | (bool hasResultLeft, T result) result; 84 | 85 | try 86 | { 87 | result = await WhenAny(TaskA(cts.Token), TaskB(cts.Token)); 88 | cts.Cancel(); 89 | } 90 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 91 | { 92 | if (cancellationToken.IsCancellationRequested) 93 | { 94 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 95 | } 96 | 97 | throw; 98 | } 99 | finally 100 | { 101 | cts.Dispose(); 102 | } 103 | 104 | ... 105 | } 106 | 107 | // with UniTask Supplement 108 | var (hasResultLeft, result) = await UniTask.WhenAny( 109 | cancel => TaskA(cancel), 110 | cancel => TaskB(cancel), 111 | cancellationToken 112 | ); 113 | ``` 114 | 115 | ```csharp 116 | // UniTask 117 | { 118 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 119 | (int winArgumentIndex, T result) result = default; 120 | 121 | try 122 | { 123 | result = await WhenAny( 124 | taskFunc1(cts.Token), 125 | taskFunc2(cts.Token), 126 | .. 127 | ); 128 | 129 | cts.Cancel(); 130 | } 131 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 132 | { 133 | if (cancellationToken.IsCancellationRequested) 134 | { 135 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 136 | } 137 | 138 | throw; 139 | } 140 | finally 141 | { 142 | cts.Dispose(); 143 | } 144 | 145 | ... 146 | } 147 | 148 | // with UniTask Supplement 149 | var (winArgumentIndex, result) = await UniTask.WhenAny( 150 | cancel => TaskA(cancel), 151 | cancel => TaskB(cancel), 152 | .., 153 | cancellationToken 154 | ); 155 | ``` 156 | 157 | You can disable `WhenAny(.., cancellationToken)` to define `UNITASK_SUPPLEMENT_DISABLE_WHEN_ANY`. 158 | 159 | ### DOTween integration 160 | #### Shorthands 161 | ```csharp 162 | // UniTask 163 | await tween.ToUniTask(cancellationToken: cancellationToken); 164 | await tween.AwaitForComplete(cancellationToken: cancellationToken); 165 | await tween.AwaitForPause(cancellationToken: cancellationToken); 166 | await tween.AwaitForPlay(cancellationToken: cancellationToken); 167 | await tween.AwaitForRewind(cancellationToken: cancellationToken); 168 | await tween.AwaitForStepComplete(cancellationToken: cancellationToken); 169 | 170 | // with UniTask Supplement 171 | await tween.ToUniTask(cancellationToken); 172 | await tween.AwaitForComplete(cancellationToken); 173 | await tween.AwaitForPause(cancellationToken); 174 | await tween.AwaitForPlay(cancellationToken); 175 | await tween.AwaitForRewind(cancellationToken); 176 | await tween.AwaitForStepComplete(cancellationToken); 177 | ``` 178 | 179 | You can **enable** this behavior to define `UNITASK_SUPPLEMENT_DOTWEEN_SUPPORT` instead of `UNITASK_DOTWEEN_SUPPORT`. 180 | 181 | #### Change default value of `TweenCancelBehaviour` to `KillAndCancelAwait` 182 | See [this thread (Twitter)](https://twitter.com/ishida_gigacee/status/1569951411160645633?s=20) for why this should be. 183 | 184 | ```csharp 185 | // UniTask 186 | // OperationCanceledException will not be thrown when canceled. 187 | await tween.WithCancellation(cancellationToken); 188 | await tween.ToUniTask(cancellationToken: cancellationToken); 189 | await tween.AwaitForComplete(cancellationToken: cancellationToken); 190 | await tween.AwaitForPause(cancellationToken: cancellationToken); 191 | await tween.AwaitForPlay(cancellationToken: cancellationToken); 192 | await tween.AwaitForRewind(cancellationToken: cancellationToken); 193 | await tween.AwaitForStepComplete(cancellationToken: cancellationToken); 194 | 195 | // but with UniTask Supplement, OperationCanceledException will be thrown when canceled. 196 | ``` 197 | 198 | ```csharp 199 | // UniTask 200 | await tween.ToUniTask(TweenCancelBehaviour.KillAndCancelAwait, cancellationToken); 201 | await tween.AwaitForComplete(TweenCancelBehaviour.KillAndCancelAwait, cancellationToken); 202 | await tween.AwaitForPause(TweenCancelBehaviour.KillAndCancelAwait, cancellationToken); 203 | await tween.AwaitForPlay(TweenCancelBehaviour.KillAndCancelAwait, cancellationToken); 204 | await tween.AwaitForRewind(TweenCancelBehaviour.KillAndCancelAwait, cancellationToken); 205 | await tween.AwaitForStepComplete(TweenCancelBehaviour.KillAndCancelAwait, cancellationToken); 206 | 207 | // with UniTask Supplement 208 | await tween.ToUniTask(cancellationToken); 209 | await tween.AwaitForComplete(cancellationToken); 210 | await tween.AwaitForPause(cancellationToken); 211 | await tween.AwaitForPlay(cancellationToken); 212 | await tween.AwaitForRewind(cancellationToken); 213 | await tween.AwaitForStepComplete(cancellationToken); 214 | ``` 215 | 216 | You can restore original behavior to define `UNITASK_SUPPLEMENT_DOTWEEN_SUPPORT_USE_ORIGINAL_DEFAULT_TWEEN_CANCEL_BEHAVIOUR`. 217 | 218 | ## Installation 219 | ### Install via OpenUPM (Recommended) 220 | The package is available on the [openupm registry](https://openupm.com/). It's recommended to install it via [openupm-cli](https://github.com/openupm/openupm-cli). 221 | 222 | `openupm add com.jagapippi.unitask-supplement` 223 | 224 | ### Install via git URL 225 | 1. Open the Package Manager 226 | 1. Press [+▼] button and click Add package from git URL... 227 | 1. Enter the following: 228 | - https://github.com/su10/UniTask-Supplement.git#upm 229 | 230 | or add a following line to dependencies field of your Packages/manifest.json. 231 | 232 | `"com.jagapippi.unitask-supplement": "https://github.com/su10/UniTask-Supplement.git#upm"` 233 | 234 | ## License 235 | MIT 236 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 705507994} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 500 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 500 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 2 83 | m_PVRDenoiserTypeDirect: 0 84 | m_PVRDenoiserTypeIndirect: 0 85 | m_PVRDenoiserTypeAO: 0 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 0 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 0} 101 | m_LightingSettings: {fileID: 0} 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 2 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | accuratePlacement: 0 121 | debug: 122 | m_Flags: 0 123 | m_NavMeshData: {fileID: 0} 124 | --- !u!1 &705507993 125 | GameObject: 126 | m_ObjectHideFlags: 0 127 | m_CorrespondingSourceObject: {fileID: 0} 128 | m_PrefabInternal: {fileID: 0} 129 | serializedVersion: 6 130 | m_Component: 131 | - component: {fileID: 705507995} 132 | - component: {fileID: 705507994} 133 | m_Layer: 0 134 | m_Name: Directional Light 135 | m_TagString: Untagged 136 | m_Icon: {fileID: 0} 137 | m_NavMeshLayer: 0 138 | m_StaticEditorFlags: 0 139 | m_IsActive: 1 140 | --- !u!108 &705507994 141 | Light: 142 | m_ObjectHideFlags: 0 143 | m_CorrespondingSourceObject: {fileID: 0} 144 | m_PrefabInternal: {fileID: 0} 145 | m_GameObject: {fileID: 705507993} 146 | m_Enabled: 1 147 | serializedVersion: 8 148 | m_Type: 1 149 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 150 | m_Intensity: 1 151 | m_Range: 10 152 | m_SpotAngle: 30 153 | m_CookieSize: 10 154 | m_Shadows: 155 | m_Type: 2 156 | m_Resolution: -1 157 | m_CustomResolution: -1 158 | m_Strength: 1 159 | m_Bias: 0.05 160 | m_NormalBias: 0.4 161 | m_NearPlane: 0.2 162 | m_Cookie: {fileID: 0} 163 | m_DrawHalo: 0 164 | m_Flare: {fileID: 0} 165 | m_RenderMode: 0 166 | m_CullingMask: 167 | serializedVersion: 2 168 | m_Bits: 4294967295 169 | m_Lightmapping: 1 170 | m_LightShadowCasterMode: 0 171 | m_AreaSize: {x: 1, y: 1} 172 | m_BounceIntensity: 1 173 | m_ColorTemperature: 6570 174 | m_UseColorTemperature: 0 175 | m_ShadowRadius: 0 176 | m_ShadowAngle: 0 177 | --- !u!4 &705507995 178 | Transform: 179 | m_ObjectHideFlags: 0 180 | m_CorrespondingSourceObject: {fileID: 0} 181 | m_PrefabInternal: {fileID: 0} 182 | m_GameObject: {fileID: 705507993} 183 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 184 | m_LocalPosition: {x: 0, y: 3, z: 0} 185 | m_LocalScale: {x: 1, y: 1, z: 1} 186 | m_Children: [] 187 | m_Father: {fileID: 0} 188 | m_RootOrder: 1 189 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 190 | --- !u!1 &963194225 191 | GameObject: 192 | m_ObjectHideFlags: 0 193 | m_CorrespondingSourceObject: {fileID: 0} 194 | m_PrefabInternal: {fileID: 0} 195 | serializedVersion: 6 196 | m_Component: 197 | - component: {fileID: 963194228} 198 | - component: {fileID: 963194227} 199 | - component: {fileID: 963194226} 200 | m_Layer: 0 201 | m_Name: Main Camera 202 | m_TagString: MainCamera 203 | m_Icon: {fileID: 0} 204 | m_NavMeshLayer: 0 205 | m_StaticEditorFlags: 0 206 | m_IsActive: 1 207 | --- !u!81 &963194226 208 | AudioListener: 209 | m_ObjectHideFlags: 0 210 | m_CorrespondingSourceObject: {fileID: 0} 211 | m_PrefabInternal: {fileID: 0} 212 | m_GameObject: {fileID: 963194225} 213 | m_Enabled: 1 214 | --- !u!20 &963194227 215 | Camera: 216 | m_ObjectHideFlags: 0 217 | m_CorrespondingSourceObject: {fileID: 0} 218 | m_PrefabInternal: {fileID: 0} 219 | m_GameObject: {fileID: 963194225} 220 | m_Enabled: 1 221 | serializedVersion: 2 222 | m_ClearFlags: 1 223 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 224 | m_projectionMatrixMode: 1 225 | m_SensorSize: {x: 36, y: 24} 226 | m_LensShift: {x: 0, y: 0} 227 | m_GateFitMode: 2 228 | m_FocalLength: 50 229 | m_NormalizedViewPortRect: 230 | serializedVersion: 2 231 | x: 0 232 | y: 0 233 | width: 1 234 | height: 1 235 | near clip plane: 0.3 236 | far clip plane: 1000 237 | field of view: 60 238 | orthographic: 0 239 | orthographic size: 5 240 | m_Depth: -1 241 | m_CullingMask: 242 | serializedVersion: 2 243 | m_Bits: 4294967295 244 | m_RenderingPath: -1 245 | m_TargetTexture: {fileID: 0} 246 | m_TargetDisplay: 0 247 | m_TargetEye: 3 248 | m_HDR: 1 249 | m_AllowMSAA: 1 250 | m_AllowDynamicResolution: 0 251 | m_ForceIntoRT: 0 252 | m_OcclusionCulling: 1 253 | m_StereoConvergence: 10 254 | m_StereoSeparation: 0.022 255 | --- !u!4 &963194228 256 | Transform: 257 | m_ObjectHideFlags: 0 258 | m_CorrespondingSourceObject: {fileID: 0} 259 | m_PrefabInternal: {fileID: 0} 260 | m_GameObject: {fileID: 963194225} 261 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 262 | m_LocalPosition: {x: 0, y: 1, z: -10} 263 | m_LocalScale: {x: 1, y: 1, z: 1} 264 | m_Children: [] 265 | m_Father: {fileID: 0} 266 | m_RootOrder: 0 267 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 268 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.cysharp.unitask": { 4 | "version": "2.3.3", 5 | "depth": 0, 6 | "source": "registry", 7 | "dependencies": {}, 8 | "url": "https://package.openupm.com" 9 | }, 10 | "com.unity.ext.nunit": { 11 | "version": "2.0.3", 12 | "depth": 1, 13 | "source": "registry", 14 | "dependencies": {}, 15 | "url": "https://packages.unity.com" 16 | }, 17 | "com.unity.ide.rider": { 18 | "version": "3.0.18", 19 | "depth": 0, 20 | "source": "registry", 21 | "dependencies": { 22 | "com.unity.ext.nunit": "1.0.6" 23 | }, 24 | "url": "https://packages.unity.com" 25 | }, 26 | "com.unity.ide.visualstudio": { 27 | "version": "2.0.17", 28 | "depth": 0, 29 | "source": "registry", 30 | "dependencies": { 31 | "com.unity.test-framework": "1.1.9" 32 | }, 33 | "url": "https://packages.unity.com" 34 | }, 35 | "com.unity.ide.vscode": { 36 | "version": "1.2.5", 37 | "depth": 0, 38 | "source": "registry", 39 | "dependencies": {}, 40 | "url": "https://packages.unity.com" 41 | }, 42 | "com.unity.test-framework": { 43 | "version": "1.3.3", 44 | "depth": 0, 45 | "source": "registry", 46 | "dependencies": { 47 | "com.unity.ext.nunit": "2.0.3", 48 | "com.unity.modules.imgui": "1.0.0", 49 | "com.unity.modules.jsonserialize": "1.0.0" 50 | }, 51 | "url": "https://packages.unity.com" 52 | }, 53 | "com.unity.ugui": { 54 | "version": "1.0.0", 55 | "depth": 0, 56 | "source": "builtin", 57 | "dependencies": { 58 | "com.unity.modules.ui": "1.0.0", 59 | "com.unity.modules.imgui": "1.0.0" 60 | } 61 | }, 62 | "com.unity.modules.ai": { 63 | "version": "1.0.0", 64 | "depth": 0, 65 | "source": "builtin", 66 | "dependencies": {} 67 | }, 68 | "com.unity.modules.androidjni": { 69 | "version": "1.0.0", 70 | "depth": 0, 71 | "source": "builtin", 72 | "dependencies": {} 73 | }, 74 | "com.unity.modules.animation": { 75 | "version": "1.0.0", 76 | "depth": 0, 77 | "source": "builtin", 78 | "dependencies": {} 79 | }, 80 | "com.unity.modules.assetbundle": { 81 | "version": "1.0.0", 82 | "depth": 0, 83 | "source": "builtin", 84 | "dependencies": {} 85 | }, 86 | "com.unity.modules.audio": { 87 | "version": "1.0.0", 88 | "depth": 0, 89 | "source": "builtin", 90 | "dependencies": {} 91 | }, 92 | "com.unity.modules.cloth": { 93 | "version": "1.0.0", 94 | "depth": 0, 95 | "source": "builtin", 96 | "dependencies": { 97 | "com.unity.modules.physics": "1.0.0" 98 | } 99 | }, 100 | "com.unity.modules.director": { 101 | "version": "1.0.0", 102 | "depth": 0, 103 | "source": "builtin", 104 | "dependencies": { 105 | "com.unity.modules.audio": "1.0.0", 106 | "com.unity.modules.animation": "1.0.0" 107 | } 108 | }, 109 | "com.unity.modules.imageconversion": { 110 | "version": "1.0.0", 111 | "depth": 0, 112 | "source": "builtin", 113 | "dependencies": {} 114 | }, 115 | "com.unity.modules.imgui": { 116 | "version": "1.0.0", 117 | "depth": 0, 118 | "source": "builtin", 119 | "dependencies": {} 120 | }, 121 | "com.unity.modules.jsonserialize": { 122 | "version": "1.0.0", 123 | "depth": 0, 124 | "source": "builtin", 125 | "dependencies": {} 126 | }, 127 | "com.unity.modules.particlesystem": { 128 | "version": "1.0.0", 129 | "depth": 0, 130 | "source": "builtin", 131 | "dependencies": {} 132 | }, 133 | "com.unity.modules.physics": { 134 | "version": "1.0.0", 135 | "depth": 0, 136 | "source": "builtin", 137 | "dependencies": {} 138 | }, 139 | "com.unity.modules.physics2d": { 140 | "version": "1.0.0", 141 | "depth": 0, 142 | "source": "builtin", 143 | "dependencies": {} 144 | }, 145 | "com.unity.modules.screencapture": { 146 | "version": "1.0.0", 147 | "depth": 0, 148 | "source": "builtin", 149 | "dependencies": { 150 | "com.unity.modules.imageconversion": "1.0.0" 151 | } 152 | }, 153 | "com.unity.modules.subsystems": { 154 | "version": "1.0.0", 155 | "depth": 1, 156 | "source": "builtin", 157 | "dependencies": { 158 | "com.unity.modules.jsonserialize": "1.0.0" 159 | } 160 | }, 161 | "com.unity.modules.terrain": { 162 | "version": "1.0.0", 163 | "depth": 0, 164 | "source": "builtin", 165 | "dependencies": {} 166 | }, 167 | "com.unity.modules.terrainphysics": { 168 | "version": "1.0.0", 169 | "depth": 0, 170 | "source": "builtin", 171 | "dependencies": { 172 | "com.unity.modules.physics": "1.0.0", 173 | "com.unity.modules.terrain": "1.0.0" 174 | } 175 | }, 176 | "com.unity.modules.tilemap": { 177 | "version": "1.0.0", 178 | "depth": 0, 179 | "source": "builtin", 180 | "dependencies": { 181 | "com.unity.modules.physics2d": "1.0.0" 182 | } 183 | }, 184 | "com.unity.modules.ui": { 185 | "version": "1.0.0", 186 | "depth": 0, 187 | "source": "builtin", 188 | "dependencies": {} 189 | }, 190 | "com.unity.modules.uielements": { 191 | "version": "1.0.0", 192 | "depth": 0, 193 | "source": "builtin", 194 | "dependencies": { 195 | "com.unity.modules.ui": "1.0.0", 196 | "com.unity.modules.imgui": "1.0.0", 197 | "com.unity.modules.jsonserialize": "1.0.0", 198 | "com.unity.modules.uielementsnative": "1.0.0" 199 | } 200 | }, 201 | "com.unity.modules.uielementsnative": { 202 | "version": "1.0.0", 203 | "depth": 1, 204 | "source": "builtin", 205 | "dependencies": { 206 | "com.unity.modules.ui": "1.0.0", 207 | "com.unity.modules.imgui": "1.0.0", 208 | "com.unity.modules.jsonserialize": "1.0.0" 209 | } 210 | }, 211 | "com.unity.modules.umbra": { 212 | "version": "1.0.0", 213 | "depth": 0, 214 | "source": "builtin", 215 | "dependencies": {} 216 | }, 217 | "com.unity.modules.unityanalytics": { 218 | "version": "1.0.0", 219 | "depth": 0, 220 | "source": "builtin", 221 | "dependencies": { 222 | "com.unity.modules.unitywebrequest": "1.0.0", 223 | "com.unity.modules.jsonserialize": "1.0.0" 224 | } 225 | }, 226 | "com.unity.modules.unitywebrequest": { 227 | "version": "1.0.0", 228 | "depth": 0, 229 | "source": "builtin", 230 | "dependencies": {} 231 | }, 232 | "com.unity.modules.unitywebrequestassetbundle": { 233 | "version": "1.0.0", 234 | "depth": 0, 235 | "source": "builtin", 236 | "dependencies": { 237 | "com.unity.modules.assetbundle": "1.0.0", 238 | "com.unity.modules.unitywebrequest": "1.0.0" 239 | } 240 | }, 241 | "com.unity.modules.unitywebrequestaudio": { 242 | "version": "1.0.0", 243 | "depth": 0, 244 | "source": "builtin", 245 | "dependencies": { 246 | "com.unity.modules.unitywebrequest": "1.0.0", 247 | "com.unity.modules.audio": "1.0.0" 248 | } 249 | }, 250 | "com.unity.modules.unitywebrequesttexture": { 251 | "version": "1.0.0", 252 | "depth": 0, 253 | "source": "builtin", 254 | "dependencies": { 255 | "com.unity.modules.unitywebrequest": "1.0.0", 256 | "com.unity.modules.imageconversion": "1.0.0" 257 | } 258 | }, 259 | "com.unity.modules.unitywebrequestwww": { 260 | "version": "1.0.0", 261 | "depth": 0, 262 | "source": "builtin", 263 | "dependencies": { 264 | "com.unity.modules.unitywebrequest": "1.0.0", 265 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 266 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 267 | "com.unity.modules.audio": "1.0.0", 268 | "com.unity.modules.assetbundle": "1.0.0", 269 | "com.unity.modules.imageconversion": "1.0.0" 270 | } 271 | }, 272 | "com.unity.modules.vehicles": { 273 | "version": "1.0.0", 274 | "depth": 0, 275 | "source": "builtin", 276 | "dependencies": { 277 | "com.unity.modules.physics": "1.0.0" 278 | } 279 | }, 280 | "com.unity.modules.video": { 281 | "version": "1.0.0", 282 | "depth": 0, 283 | "source": "builtin", 284 | "dependencies": { 285 | "com.unity.modules.audio": "1.0.0", 286 | "com.unity.modules.ui": "1.0.0", 287 | "com.unity.modules.unitywebrequest": "1.0.0" 288 | } 289 | }, 290 | "com.unity.modules.vr": { 291 | "version": "1.0.0", 292 | "depth": 0, 293 | "source": "builtin", 294 | "dependencies": { 295 | "com.unity.modules.jsonserialize": "1.0.0", 296 | "com.unity.modules.physics": "1.0.0", 297 | "com.unity.modules.xr": "1.0.0" 298 | } 299 | }, 300 | "com.unity.modules.wind": { 301 | "version": "1.0.0", 302 | "depth": 0, 303 | "source": "builtin", 304 | "dependencies": {} 305 | }, 306 | "com.unity.modules.xr": { 307 | "version": "1.0.0", 308 | "depth": 0, 309 | "source": "builtin", 310 | "dependencies": { 311 | "com.unity.modules.physics": "1.0.0", 312 | "com.unity.modules.jsonserialize": "1.0.0", 313 | "com.unity.modules.subsystems": "1.0.0" 314 | } 315 | } 316 | } 317 | } 318 | -------------------------------------------------------------------------------- /UniTask-Supplement.sln.DotSettings: -------------------------------------------------------------------------------- 1 | 2 | False 3 | DO_NOT_SHOW 4 | SUGGESTION 5 | SUGGESTION 6 | HINT 7 | DO_NOT_SHOW 8 | True 9 | <?xml version="1.0" encoding="utf-16"?><Profile name="Built-in: Reformat Code &amp; Optimize 'using' directives"><CppReformatCode>True</CppReformatCode><ShaderLabReformatCode>True</ShaderLabReformatCode><XAMLCollapseEmptyTags>False</XAMLCollapseEmptyTags><XMLReformatCode>True</XMLReformatCode><HtmlReformatCode>True</HtmlReformatCode><VBReformatCode>True</VBReformatCode><CSReformatCode>True</CSReformatCode><IDEA_SETTINGS>&lt;profile version="1.0"&gt; 10 | &lt;option name="myName" value="Built-in: Reformat Code &amp;amp; Optimize 'using' directives" /&gt; 11 | &lt;inspection_tool class="ES6ShorthandObjectProperty" enabled="false" level="INFORMATION" enabled_by_default="false" /&gt; 12 | &lt;inspection_tool class="JSArrowFunctionBracesCanBeRemoved" enabled="false" level="INFORMATION" enabled_by_default="false" /&gt; 13 | &lt;inspection_tool class="JSPrimitiveTypeWrapperUsage" enabled="false" level="WARNING" enabled_by_default="false" /&gt; 14 | &lt;inspection_tool class="JSRemoveUnnecessaryParentheses" enabled="false" level="INFORMATION" enabled_by_default="false" /&gt; 15 | &lt;inspection_tool class="JSUnnecessarySemicolon" enabled="false" level="WARNING" enabled_by_default="false" /&gt; 16 | &lt;inspection_tool class="TypeScriptExplicitMemberType" enabled="false" level="INFORMATION" enabled_by_default="false" /&gt; 17 | &lt;inspection_tool class="UnnecessaryContinueJS" enabled="false" level="WARNING" enabled_by_default="false" /&gt; 18 | &lt;inspection_tool class="UnnecessaryLabelJS" enabled="false" level="WARNING" enabled_by_default="false" /&gt; 19 | &lt;inspection_tool class="UnnecessaryLabelOnBreakStatementJS" enabled="false" level="WARNING" enabled_by_default="false" /&gt; 20 | &lt;inspection_tool class="UnnecessaryLabelOnContinueStatementJS" enabled="false" level="WARNING" enabled_by_default="false" /&gt; 21 | &lt;inspection_tool class="UnnecessaryReturnJS" enabled="false" level="WARNING" enabled_by_default="false" /&gt; 22 | &lt;inspection_tool class="WrongPropertyKeyValueDelimiter" enabled="false" level="WEAK WARNING" enabled_by_default="false" /&gt; 23 | &lt;/profile&gt;</IDEA_SETTINGS><RIDER_SETTINGS>&lt;profile&gt; 24 | &lt;Language id="AppleScript"&gt; 25 | &lt;Reformat&gt;true&lt;/Reformat&gt; 26 | &lt;/Language&gt; 27 | &lt;Language id="CSS"&gt; 28 | &lt;Rearrange&gt;false&lt;/Rearrange&gt; 29 | &lt;Reformat&gt;true&lt;/Reformat&gt; 30 | &lt;/Language&gt; 31 | &lt;Language id="EditorConfig"&gt; 32 | &lt;Reformat&gt;true&lt;/Reformat&gt; 33 | &lt;/Language&gt; 34 | &lt;Language id="HTML"&gt; 35 | &lt;Rearrange&gt;false&lt;/Rearrange&gt; 36 | &lt;Reformat&gt;true&lt;/Reformat&gt; 37 | &lt;OptimizeImports&gt;false&lt;/OptimizeImports&gt; 38 | &lt;/Language&gt; 39 | &lt;Language id="HTTP Request"&gt; 40 | &lt;Reformat&gt;true&lt;/Reformat&gt; 41 | &lt;/Language&gt; 42 | &lt;Language id="Handlebars"&gt; 43 | &lt;Reformat&gt;true&lt;/Reformat&gt; 44 | &lt;/Language&gt; 45 | &lt;Language id="Ini"&gt; 46 | &lt;Reformat&gt;true&lt;/Reformat&gt; 47 | &lt;/Language&gt; 48 | &lt;Language id="JSON"&gt; 49 | &lt;Reformat&gt;true&lt;/Reformat&gt; 50 | &lt;/Language&gt; 51 | &lt;Language id="Jade"&gt; 52 | &lt;Reformat&gt;true&lt;/Reformat&gt; 53 | &lt;/Language&gt; 54 | &lt;Language id="JavaScript"&gt; 55 | &lt;Rearrange&gt;false&lt;/Rearrange&gt; 56 | &lt;Reformat&gt;true&lt;/Reformat&gt; 57 | &lt;OptimizeImports&gt;false&lt;/OptimizeImports&gt; 58 | &lt;/Language&gt; 59 | &lt;Language id="Markdown"&gt; 60 | &lt;Reformat&gt;true&lt;/Reformat&gt; 61 | &lt;/Language&gt; 62 | &lt;Language id="Properties"&gt; 63 | &lt;Reformat&gt;true&lt;/Reformat&gt; 64 | &lt;/Language&gt; 65 | &lt;Language id="RELAX-NG"&gt; 66 | &lt;Reformat&gt;true&lt;/Reformat&gt; 67 | &lt;/Language&gt; 68 | &lt;Language id="SQL"&gt; 69 | &lt;Reformat&gt;true&lt;/Reformat&gt; 70 | &lt;/Language&gt; 71 | &lt;Language id="XML"&gt; 72 | &lt;Rearrange&gt;false&lt;/Rearrange&gt; 73 | &lt;Reformat&gt;true&lt;/Reformat&gt; 74 | &lt;OptimizeImports&gt;false&lt;/OptimizeImports&gt; 75 | &lt;/Language&gt; 76 | &lt;Language id="yaml"&gt; 77 | &lt;Reformat&gt;true&lt;/Reformat&gt; 78 | &lt;/Language&gt; 79 | &lt;/profile&gt;</RIDER_SETTINGS><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings></CSOptimizeUsings></Profile> 80 | Built-in: Reformat Code & Optimize 'using' directives 81 | Built-in: Reformat Code & Optimize 'using' directives 82 | True 83 | True 84 | 1 85 | 1 86 | True 87 | True 88 | 120 89 | 1 90 | True 91 | False 92 | False 93 | True 94 | False 95 | True 96 | False 97 | False 98 | True 99 | False 100 | True 101 | False 102 | False 103 | True 104 | <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> 105 | <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> 106 | <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> 107 | <Policy><Descriptor Staticness="Instance" AccessRightKinds="Any" Description="Unity serialized field"><ElementKinds><Kind Name="UNITY_SERIALISED_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /></Policy> 108 | 109 | True 110 | True 111 | True 112 | True 113 | True -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask.DOTween/Scripts/DOTweenAsyncExtensions.cs: -------------------------------------------------------------------------------- 1 | // asmdef Version Defines, enabled when com.demigiant.dotween is imported. 2 | 3 | #if UNITASK_SUPPLEMENT_DOTWEEN_SUPPORT 4 | 5 | using Cysharp.Threading.Tasks.Internal; 6 | using DG.Tweening; 7 | using System; 8 | using System.Collections.Concurrent; 9 | using System.Runtime.CompilerServices; 10 | using System.Threading; 11 | 12 | namespace Cysharp.Threading.Tasks 13 | { 14 | public enum TweenCancelBehaviour 15 | { 16 | Kill, 17 | KillWithCompleteCallback, 18 | Complete, 19 | CompleteWithSequenceCallback, 20 | CancelAwait, 21 | 22 | // AndCancelAwait 23 | KillAndCancelAwait, 24 | KillWithCompleteCallbackAndCancelAwait, 25 | CompleteAndCancelAwait, 26 | CompleteWithSequenceCallbackAndCancelAwait 27 | } 28 | 29 | public static partial class DOTweenAsyncExtensions 30 | { 31 | enum CallbackType 32 | { 33 | Kill, 34 | Complete, 35 | Pause, 36 | Play, 37 | Rewind, 38 | StepComplete 39 | } 40 | 41 | public static TweenAwaiter GetAwaiter(this Tween tween) 42 | { 43 | return new TweenAwaiter(tween); 44 | } 45 | 46 | public static UniTask WithCancellation(this Tween tween, CancellationToken cancellationToken) 47 | { 48 | Error.ThrowArgumentNullException(tween, nameof(tween)); 49 | 50 | if (!tween.IsActive()) return UniTask.CompletedTask; 51 | return new UniTask(TweenConfiguredSource.Create(tween, DefaultTweenCancelBehaviour, cancellationToken, CallbackType.Kill, out var token), token); 52 | } 53 | 54 | public static UniTask ToUniTask(this Tween tween, TweenCancelBehaviour tweenCancelBehaviour = DefaultTweenCancelBehaviour, CancellationToken cancellationToken = default) 55 | { 56 | Error.ThrowArgumentNullException(tween, nameof(tween)); 57 | 58 | if (!tween.IsActive()) return UniTask.CompletedTask; 59 | return new UniTask(TweenConfiguredSource.Create(tween, tweenCancelBehaviour, cancellationToken, CallbackType.Kill, out var token), token); 60 | } 61 | 62 | public static UniTask AwaitForComplete(this Tween tween, TweenCancelBehaviour tweenCancelBehaviour = DefaultTweenCancelBehaviour, CancellationToken cancellationToken = default) 63 | { 64 | Error.ThrowArgumentNullException(tween, nameof(tween)); 65 | 66 | if (!tween.IsActive()) return UniTask.CompletedTask; 67 | return new UniTask(TweenConfiguredSource.Create(tween, tweenCancelBehaviour, cancellationToken, CallbackType.Complete, out var token), token); 68 | } 69 | 70 | public static UniTask AwaitForPause(this Tween tween, TweenCancelBehaviour tweenCancelBehaviour = DefaultTweenCancelBehaviour, CancellationToken cancellationToken = default) 71 | { 72 | Error.ThrowArgumentNullException(tween, nameof(tween)); 73 | 74 | if (!tween.IsActive()) return UniTask.CompletedTask; 75 | return new UniTask(TweenConfiguredSource.Create(tween, tweenCancelBehaviour, cancellationToken, CallbackType.Pause, out var token), token); 76 | } 77 | 78 | public static UniTask AwaitForPlay(this Tween tween, TweenCancelBehaviour tweenCancelBehaviour = DefaultTweenCancelBehaviour, CancellationToken cancellationToken = default) 79 | { 80 | Error.ThrowArgumentNullException(tween, nameof(tween)); 81 | 82 | if (!tween.IsActive()) return UniTask.CompletedTask; 83 | return new UniTask(TweenConfiguredSource.Create(tween, tweenCancelBehaviour, cancellationToken, CallbackType.Play, out var token), token); 84 | } 85 | 86 | public static UniTask AwaitForRewind(this Tween tween, TweenCancelBehaviour tweenCancelBehaviour = DefaultTweenCancelBehaviour, CancellationToken cancellationToken = default) 87 | { 88 | Error.ThrowArgumentNullException(tween, nameof(tween)); 89 | 90 | if (!tween.IsActive()) return UniTask.CompletedTask; 91 | return new UniTask(TweenConfiguredSource.Create(tween, tweenCancelBehaviour, cancellationToken, CallbackType.Rewind, out var token), token); 92 | } 93 | 94 | public static UniTask AwaitForStepComplete(this Tween tween, TweenCancelBehaviour tweenCancelBehaviour = DefaultTweenCancelBehaviour, CancellationToken cancellationToken = default) 95 | { 96 | Error.ThrowArgumentNullException(tween, nameof(tween)); 97 | 98 | if (!tween.IsActive()) return UniTask.CompletedTask; 99 | return new UniTask(TweenConfiguredSource.Create(tween, tweenCancelBehaviour, cancellationToken, CallbackType.StepComplete, out var token), token); 100 | } 101 | 102 | public struct TweenAwaiter : ICriticalNotifyCompletion 103 | { 104 | readonly Tween tween; 105 | 106 | // killed(non active) as completed. 107 | public bool IsCompleted => !tween.IsActive(); 108 | 109 | public TweenAwaiter(Tween tween) 110 | { 111 | this.tween = tween; 112 | } 113 | 114 | public TweenAwaiter GetAwaiter() 115 | { 116 | return this; 117 | } 118 | 119 | public void GetResult() 120 | { 121 | } 122 | 123 | public void OnCompleted(System.Action continuation) 124 | { 125 | UnsafeOnCompleted(continuation); 126 | } 127 | 128 | public void UnsafeOnCompleted(System.Action continuation) 129 | { 130 | // onKill is called after OnCompleted, both Complete(false/true) and Kill(false/true). 131 | tween.onKill = PooledTweenCallback.Create(continuation); 132 | } 133 | } 134 | 135 | sealed class TweenConfiguredSource : IUniTaskSource, ITaskPoolNode 136 | { 137 | static TaskPool pool; 138 | TweenConfiguredSource nextNode; 139 | public ref TweenConfiguredSource NextNode => ref nextNode; 140 | 141 | static TweenConfiguredSource() 142 | { 143 | TaskPool.RegisterSizeGetter(typeof(TweenConfiguredSource), () => pool.Size); 144 | } 145 | 146 | readonly TweenCallback onCompleteCallbackDelegate; 147 | readonly TweenCallback onUpdateDelegate; 148 | 149 | Tween tween; 150 | TweenCancelBehaviour cancelBehaviour; 151 | CancellationToken cancellationToken; 152 | CallbackType callbackType; 153 | bool canceled; 154 | 155 | TweenCallback originalUpdateAction; 156 | TweenCallback originalCompleteAction; 157 | UniTaskCompletionSourceCore core; 158 | 159 | TweenConfiguredSource() 160 | { 161 | onCompleteCallbackDelegate = OnCompleteCallbackDelegate; 162 | onUpdateDelegate = OnUpdate; 163 | } 164 | 165 | public static IUniTaskSource Create(Tween tween, TweenCancelBehaviour cancelBehaviour, CancellationToken cancellationToken, CallbackType callbackType, out short token) 166 | { 167 | if (cancellationToken.IsCancellationRequested) 168 | { 169 | DoCancelBeforeCreate(tween, cancelBehaviour); 170 | return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); 171 | } 172 | 173 | if (!pool.TryPop(out var result)) 174 | { 175 | result = new TweenConfiguredSource(); 176 | } 177 | 178 | result.tween = tween; 179 | result.cancelBehaviour = cancelBehaviour; 180 | result.cancellationToken = cancellationToken; 181 | result.callbackType = callbackType; 182 | 183 | result.originalUpdateAction = tween.onUpdate; 184 | result.canceled = false; 185 | 186 | if (result.originalUpdateAction == result.onUpdateDelegate) 187 | { 188 | result.originalUpdateAction = null; 189 | } 190 | 191 | tween.onUpdate = result.onUpdateDelegate; 192 | 193 | switch (callbackType) 194 | { 195 | case CallbackType.Kill: 196 | result.originalCompleteAction = tween.onKill; 197 | tween.onKill = result.onCompleteCallbackDelegate; 198 | break; 199 | case CallbackType.Complete: 200 | result.originalCompleteAction = tween.onComplete; 201 | tween.onComplete = result.onCompleteCallbackDelegate; 202 | break; 203 | case CallbackType.Pause: 204 | result.originalCompleteAction = tween.onPause; 205 | tween.onPause = result.onCompleteCallbackDelegate; 206 | break; 207 | case CallbackType.Play: 208 | result.originalCompleteAction = tween.onPlay; 209 | tween.onPlay = result.onCompleteCallbackDelegate; 210 | break; 211 | case CallbackType.Rewind: 212 | result.originalCompleteAction = tween.onRewind; 213 | tween.onRewind = result.onCompleteCallbackDelegate; 214 | break; 215 | case CallbackType.StepComplete: 216 | result.originalCompleteAction = tween.onStepComplete; 217 | tween.onStepComplete = result.onCompleteCallbackDelegate; 218 | break; 219 | default: 220 | break; 221 | } 222 | 223 | if (result.originalCompleteAction == result.onCompleteCallbackDelegate) 224 | { 225 | result.originalCompleteAction = null; 226 | } 227 | 228 | TaskTracker.TrackActiveTask(result, 3); 229 | 230 | token = result.core.Version; 231 | return result; 232 | } 233 | 234 | void OnCompleteCallbackDelegate() 235 | { 236 | if (cancellationToken.IsCancellationRequested) 237 | { 238 | if (this.cancelBehaviour == TweenCancelBehaviour.KillAndCancelAwait 239 | || this.cancelBehaviour == TweenCancelBehaviour.KillWithCompleteCallbackAndCancelAwait 240 | || this.cancelBehaviour == TweenCancelBehaviour.CompleteAndCancelAwait 241 | || this.cancelBehaviour == TweenCancelBehaviour.CompleteWithSequenceCallbackAndCancelAwait 242 | || this.cancelBehaviour == TweenCancelBehaviour.CancelAwait) 243 | { 244 | canceled = true; 245 | } 246 | } 247 | if (canceled) 248 | { 249 | core.TrySetCanceled(cancellationToken); 250 | } 251 | else 252 | { 253 | originalCompleteAction?.Invoke(); 254 | core.TrySetResult(AsyncUnit.Default); 255 | } 256 | } 257 | 258 | void OnUpdate() 259 | { 260 | originalUpdateAction?.Invoke(); 261 | 262 | if (!cancellationToken.IsCancellationRequested) 263 | { 264 | return; 265 | } 266 | 267 | switch (this.cancelBehaviour) 268 | { 269 | case TweenCancelBehaviour.Kill: 270 | default: 271 | this.tween.Kill(false); 272 | break; 273 | case TweenCancelBehaviour.KillAndCancelAwait: 274 | this.canceled = true; 275 | this.tween.Kill(false); 276 | break; 277 | case TweenCancelBehaviour.KillWithCompleteCallback: 278 | this.tween.Kill(true); 279 | break; 280 | case TweenCancelBehaviour.KillWithCompleteCallbackAndCancelAwait: 281 | this.canceled = true; 282 | this.tween.Kill(true); 283 | break; 284 | case TweenCancelBehaviour.Complete: 285 | this.tween.Complete(false); 286 | break; 287 | case TweenCancelBehaviour.CompleteAndCancelAwait: 288 | this.canceled = true; 289 | this.tween.Complete(false); 290 | break; 291 | case TweenCancelBehaviour.CompleteWithSequenceCallback: 292 | this.tween.Complete(true); 293 | break; 294 | case TweenCancelBehaviour.CompleteWithSequenceCallbackAndCancelAwait: 295 | this.canceled = true; 296 | this.tween.Complete(true); 297 | break; 298 | case TweenCancelBehaviour.CancelAwait: 299 | // restore to original callback 300 | switch (callbackType) 301 | { 302 | case CallbackType.Kill: 303 | tween.onKill = originalCompleteAction; 304 | break; 305 | case CallbackType.Complete: 306 | tween.onComplete = originalCompleteAction; 307 | break; 308 | case CallbackType.Pause: 309 | tween.onPause = originalCompleteAction; 310 | break; 311 | case CallbackType.Play: 312 | tween.onPlay = originalCompleteAction; 313 | break; 314 | case CallbackType.Rewind: 315 | tween.onRewind = originalCompleteAction; 316 | break; 317 | case CallbackType.StepComplete: 318 | tween.onStepComplete = originalCompleteAction; 319 | break; 320 | default: 321 | break; 322 | } 323 | 324 | this.core.TrySetCanceled(this.cancellationToken); 325 | break; 326 | } 327 | } 328 | 329 | static void DoCancelBeforeCreate(Tween tween, TweenCancelBehaviour tweenCancelBehaviour) 330 | { 331 | 332 | switch (tweenCancelBehaviour) 333 | { 334 | case TweenCancelBehaviour.Kill: 335 | default: 336 | tween.Kill(false); 337 | break; 338 | case TweenCancelBehaviour.KillAndCancelAwait: 339 | tween.Kill(false); 340 | break; 341 | case TweenCancelBehaviour.KillWithCompleteCallback: 342 | tween.Kill(true); 343 | break; 344 | case TweenCancelBehaviour.KillWithCompleteCallbackAndCancelAwait: 345 | tween.Kill(true); 346 | break; 347 | case TweenCancelBehaviour.Complete: 348 | tween.Complete(false); 349 | break; 350 | case TweenCancelBehaviour.CompleteAndCancelAwait: 351 | tween.Complete(false); 352 | break; 353 | case TweenCancelBehaviour.CompleteWithSequenceCallback: 354 | tween.Complete(true); 355 | break; 356 | case TweenCancelBehaviour.CompleteWithSequenceCallbackAndCancelAwait: 357 | tween.Complete(true); 358 | break; 359 | case TweenCancelBehaviour.CancelAwait: 360 | break; 361 | } 362 | } 363 | 364 | public void GetResult(short token) 365 | { 366 | try 367 | { 368 | core.GetResult(token); 369 | } 370 | finally 371 | { 372 | TryReturn(); 373 | } 374 | } 375 | 376 | public UniTaskStatus GetStatus(short token) 377 | { 378 | return core.GetStatus(token); 379 | } 380 | 381 | public UniTaskStatus UnsafeGetStatus() 382 | { 383 | return core.UnsafeGetStatus(); 384 | } 385 | 386 | public void OnCompleted(Action continuation, object state, short token) 387 | { 388 | core.OnCompleted(continuation, state, token); 389 | } 390 | 391 | bool TryReturn() 392 | { 393 | TaskTracker.RemoveTracking(this); 394 | core.Reset(); 395 | tween.onUpdate = originalUpdateAction; 396 | 397 | switch (callbackType) 398 | { 399 | case CallbackType.Kill: 400 | tween.onKill = originalCompleteAction; 401 | break; 402 | case CallbackType.Complete: 403 | tween.onComplete = originalCompleteAction; 404 | break; 405 | case CallbackType.Pause: 406 | tween.onPause = originalCompleteAction; 407 | break; 408 | case CallbackType.Play: 409 | tween.onPlay = originalCompleteAction; 410 | break; 411 | case CallbackType.Rewind: 412 | tween.onRewind = originalCompleteAction; 413 | break; 414 | case CallbackType.StepComplete: 415 | tween.onStepComplete = originalCompleteAction; 416 | break; 417 | default: 418 | break; 419 | } 420 | 421 | tween = default; 422 | cancellationToken = default; 423 | originalUpdateAction = default; 424 | originalCompleteAction = default; 425 | return pool.TryPush(this); 426 | } 427 | } 428 | } 429 | 430 | sealed class PooledTweenCallback 431 | { 432 | static readonly ConcurrentQueue pool = new ConcurrentQueue(); 433 | 434 | readonly TweenCallback runDelegate; 435 | 436 | Action continuation; 437 | 438 | 439 | PooledTweenCallback() 440 | { 441 | runDelegate = Run; 442 | } 443 | 444 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 445 | public static TweenCallback Create(Action continuation) 446 | { 447 | if (!pool.TryDequeue(out var item)) 448 | { 449 | item = new PooledTweenCallback(); 450 | } 451 | 452 | item.continuation = continuation; 453 | return item.runDelegate; 454 | } 455 | 456 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 457 | void Run() 458 | { 459 | var call = continuation; 460 | continuation = null; 461 | if (call != null) 462 | { 463 | pool.Enqueue(this); 464 | call.Invoke(); 465 | } 466 | } 467 | } 468 | } 469 | 470 | #endif 471 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 23 7 | productGUID: fb3122b8958184e9aa45e05670018fbd 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: UniTask-Supplement 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1920 46 | defaultScreenHeight: 1080 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | mipStripping: 0 53 | numberOfMipsStripped: 0 54 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 55 | iosShowActivityIndicatorOnLoading: -1 56 | androidShowActivityIndicatorOnLoading: -1 57 | iosUseCustomAppBackgroundBehavior: 0 58 | iosAllowHTTPDownload: 1 59 | allowedAutorotateToPortrait: 1 60 | allowedAutorotateToPortraitUpsideDown: 1 61 | allowedAutorotateToLandscapeRight: 1 62 | allowedAutorotateToLandscapeLeft: 1 63 | useOSAutorotation: 1 64 | use32BitDisplayBuffer: 1 65 | preserveFramebufferAlpha: 0 66 | disableDepthAndStencilBuffers: 0 67 | androidStartInFullscreen: 1 68 | androidRenderOutsideSafeArea: 1 69 | androidUseSwappy: 1 70 | androidBlitType: 0 71 | androidResizableWindow: 0 72 | androidDefaultWindowWidth: 1920 73 | androidDefaultWindowHeight: 1080 74 | androidMinimumWindowWidth: 400 75 | androidMinimumWindowHeight: 300 76 | androidFullscreenMode: 1 77 | defaultIsNativeResolution: 1 78 | macRetinaSupport: 1 79 | runInBackground: 1 80 | captureSingleScreen: 0 81 | muteOtherAudioSources: 0 82 | Prepare IOS For Recording: 0 83 | Force IOS Speakers When Recording: 0 84 | deferSystemGesturesMode: 0 85 | hideHomeButton: 0 86 | submitAnalytics: 1 87 | usePlayerLog: 1 88 | bakeCollisionMeshes: 0 89 | forceSingleInstance: 0 90 | useFlipModelSwapchain: 1 91 | resizableWindow: 0 92 | useMacAppStoreValidation: 0 93 | macAppStoreCategory: public.app-category.games 94 | gpuSkinning: 1 95 | xboxPIXTextureCapture: 0 96 | xboxEnableAvatar: 0 97 | xboxEnableKinect: 0 98 | xboxEnableKinectAutoTracking: 0 99 | xboxEnableFitness: 0 100 | visibleInBackground: 1 101 | allowFullscreenSwitch: 1 102 | fullscreenMode: 1 103 | xboxSpeechDB: 0 104 | xboxEnableHeadOrientation: 0 105 | xboxEnableGuest: 0 106 | xboxEnablePIXSampling: 0 107 | metalFramebufferOnly: 0 108 | xboxOneResolution: 0 109 | xboxOneSResolution: 0 110 | xboxOneXResolution: 3 111 | xboxOneMonoLoggingLevel: 0 112 | xboxOneLoggingLevel: 1 113 | xboxOneDisableEsram: 0 114 | xboxOneEnableTypeOptimization: 0 115 | xboxOnePresentImmediateThreshold: 0 116 | switchQueueCommandMemory: 0 117 | switchQueueControlMemory: 16384 118 | switchQueueComputeMemory: 262144 119 | switchNVNShaderPoolsGranularity: 33554432 120 | switchNVNDefaultPoolsGranularity: 16777216 121 | switchNVNOtherPoolsGranularity: 16777216 122 | switchNVNMaxPublicTextureIDCount: 0 123 | switchNVNMaxPublicSamplerIDCount: 0 124 | stadiaPresentMode: 0 125 | stadiaTargetFramerate: 0 126 | vulkanNumSwapchainBuffers: 3 127 | vulkanEnableSetSRGBWrite: 0 128 | vulkanEnablePreTransform: 1 129 | vulkanEnableLateAcquireNextImage: 0 130 | vulkanEnableCommandBufferRecycling: 1 131 | m_SupportedAspectRatios: 132 | 4:3: 1 133 | 5:4: 1 134 | 16:10: 1 135 | 16:9: 1 136 | Others: 1 137 | bundleVersion: 0.1 138 | preloadedAssets: [] 139 | metroInputSource: 0 140 | wsaTransparentSwapchain: 0 141 | m_HolographicPauseOnTrackingLoss: 1 142 | xboxOneDisableKinectGpuReservation: 1 143 | xboxOneEnable7thCore: 1 144 | vrSettings: 145 | enable360StereoCapture: 0 146 | isWsaHolographicRemotingEnabled: 0 147 | enableFrameTimingStats: 0 148 | useHDRDisplay: 0 149 | D3DHDRBitDepth: 0 150 | m_ColorGamuts: 00000000 151 | targetPixelDensity: 30 152 | resolutionScalingMode: 0 153 | androidSupportedAspectRatio: 1 154 | androidMaxAspectRatio: 2.1 155 | applicationIdentifier: {} 156 | buildNumber: 157 | Standalone: 0 158 | iPhone: 0 159 | tvOS: 0 160 | overrideDefaultApplicationIdentifier: 0 161 | AndroidBundleVersionCode: 1 162 | AndroidMinSdkVersion: 22 163 | AndroidTargetSdkVersion: 0 164 | AndroidPreferredInstallLocation: 1 165 | aotOptions: 166 | stripEngineCode: 1 167 | iPhoneStrippingLevel: 0 168 | iPhoneScriptCallOptimization: 0 169 | ForceInternetPermission: 0 170 | ForceSDCardPermission: 0 171 | CreateWallpaper: 0 172 | APKExpansionFiles: 0 173 | keepLoadedShadersAlive: 0 174 | StripUnusedMeshComponents: 1 175 | VertexChannelCompressionMask: 4054 176 | iPhoneSdkVersion: 988 177 | iOSTargetOSVersionString: 11.0 178 | tvOSSdkVersion: 0 179 | tvOSRequireExtendedGameController: 0 180 | tvOSTargetOSVersionString: 11.0 181 | uIPrerenderedIcon: 0 182 | uIRequiresPersistentWiFi: 0 183 | uIRequiresFullScreen: 1 184 | uIStatusBarHidden: 1 185 | uIExitOnSuspend: 0 186 | uIStatusBarStyle: 0 187 | appleTVSplashScreen: {fileID: 0} 188 | appleTVSplashScreen2x: {fileID: 0} 189 | tvOSSmallIconLayers: [] 190 | tvOSSmallIconLayers2x: [] 191 | tvOSLargeIconLayers: [] 192 | tvOSLargeIconLayers2x: [] 193 | tvOSTopShelfImageLayers: [] 194 | tvOSTopShelfImageLayers2x: [] 195 | tvOSTopShelfImageWideLayers: [] 196 | tvOSTopShelfImageWideLayers2x: [] 197 | iOSLaunchScreenType: 0 198 | iOSLaunchScreenPortrait: {fileID: 0} 199 | iOSLaunchScreenLandscape: {fileID: 0} 200 | iOSLaunchScreenBackgroundColor: 201 | serializedVersion: 2 202 | rgba: 0 203 | iOSLaunchScreenFillPct: 100 204 | iOSLaunchScreenSize: 100 205 | iOSLaunchScreenCustomXibPath: 206 | iOSLaunchScreeniPadType: 0 207 | iOSLaunchScreeniPadImage: {fileID: 0} 208 | iOSLaunchScreeniPadBackgroundColor: 209 | serializedVersion: 2 210 | rgba: 0 211 | iOSLaunchScreeniPadFillPct: 100 212 | iOSLaunchScreeniPadSize: 100 213 | iOSLaunchScreeniPadCustomXibPath: 214 | iOSLaunchScreenCustomStoryboardPath: 215 | iOSLaunchScreeniPadCustomStoryboardPath: 216 | iOSDeviceRequirements: [] 217 | iOSURLSchemes: [] 218 | macOSURLSchemes: [] 219 | iOSBackgroundModes: 0 220 | iOSMetalForceHardShadows: 0 221 | metalEditorSupport: 1 222 | metalAPIValidation: 1 223 | iOSRenderExtraFrameOnPause: 0 224 | iosCopyPluginsCodeInsteadOfSymlink: 0 225 | appleDeveloperTeamID: 226 | iOSManualSigningProvisioningProfileID: 227 | tvOSManualSigningProvisioningProfileID: 228 | iOSManualSigningProvisioningProfileType: 0 229 | tvOSManualSigningProvisioningProfileType: 0 230 | appleEnableAutomaticSigning: 0 231 | iOSRequireARKit: 0 232 | iOSAutomaticallyDetectAndAddCapabilities: 1 233 | appleEnableProMotion: 0 234 | shaderPrecisionModel: 0 235 | clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea 236 | templatePackageId: com.unity.template.3d@8.0.0 237 | templateDefaultScene: Assets/Scenes/SampleScene.unity 238 | useCustomMainManifest: 0 239 | useCustomLauncherManifest: 0 240 | useCustomMainGradleTemplate: 0 241 | useCustomLauncherGradleManifest: 0 242 | useCustomBaseGradleTemplate: 0 243 | useCustomGradlePropertiesTemplate: 0 244 | useCustomProguardFile: 0 245 | AndroidTargetArchitectures: 1 246 | AndroidTargetDevices: 0 247 | AndroidSplashScreenScale: 0 248 | androidSplashScreen: {fileID: 0} 249 | AndroidKeystoreName: 250 | AndroidKeyaliasName: 251 | AndroidBuildApkPerCpuArchitecture: 0 252 | AndroidTVCompatibility: 0 253 | AndroidIsGame: 1 254 | AndroidEnableTango: 0 255 | androidEnableBanner: 1 256 | androidUseLowAccuracyLocation: 0 257 | androidUseCustomKeystore: 0 258 | m_AndroidBanners: 259 | - width: 320 260 | height: 180 261 | banner: {fileID: 0} 262 | androidGamepadSupportLevel: 0 263 | chromeosInputEmulation: 1 264 | AndroidMinifyWithR8: 0 265 | AndroidMinifyRelease: 0 266 | AndroidMinifyDebug: 0 267 | AndroidValidateAppBundleSize: 1 268 | AndroidAppBundleSizeToValidate: 150 269 | m_BuildTargetIcons: [] 270 | m_BuildTargetPlatformIcons: [] 271 | m_BuildTargetBatching: 272 | - m_BuildTarget: Standalone 273 | m_StaticBatching: 1 274 | m_DynamicBatching: 0 275 | - m_BuildTarget: tvOS 276 | m_StaticBatching: 1 277 | m_DynamicBatching: 0 278 | - m_BuildTarget: Android 279 | m_StaticBatching: 1 280 | m_DynamicBatching: 0 281 | - m_BuildTarget: iPhone 282 | m_StaticBatching: 1 283 | m_DynamicBatching: 0 284 | - m_BuildTarget: WebGL 285 | m_StaticBatching: 0 286 | m_DynamicBatching: 0 287 | m_BuildTargetGraphicsJobs: 288 | - m_BuildTarget: MacStandaloneSupport 289 | m_GraphicsJobs: 0 290 | - m_BuildTarget: Switch 291 | m_GraphicsJobs: 1 292 | - m_BuildTarget: MetroSupport 293 | m_GraphicsJobs: 1 294 | - m_BuildTarget: AppleTVSupport 295 | m_GraphicsJobs: 0 296 | - m_BuildTarget: BJMSupport 297 | m_GraphicsJobs: 1 298 | - m_BuildTarget: LinuxStandaloneSupport 299 | m_GraphicsJobs: 1 300 | - m_BuildTarget: PS4Player 301 | m_GraphicsJobs: 1 302 | - m_BuildTarget: iOSSupport 303 | m_GraphicsJobs: 0 304 | - m_BuildTarget: WindowsStandaloneSupport 305 | m_GraphicsJobs: 1 306 | - m_BuildTarget: XboxOnePlayer 307 | m_GraphicsJobs: 1 308 | - m_BuildTarget: LuminSupport 309 | m_GraphicsJobs: 0 310 | - m_BuildTarget: AndroidPlayer 311 | m_GraphicsJobs: 0 312 | - m_BuildTarget: WebGLSupport 313 | m_GraphicsJobs: 0 314 | m_BuildTargetGraphicsJobMode: 315 | - m_BuildTarget: PS4Player 316 | m_GraphicsJobMode: 0 317 | - m_BuildTarget: XboxOnePlayer 318 | m_GraphicsJobMode: 0 319 | m_BuildTargetGraphicsAPIs: 320 | - m_BuildTarget: AndroidPlayer 321 | m_APIs: 150000000b000000 322 | m_Automatic: 1 323 | - m_BuildTarget: iOSSupport 324 | m_APIs: 10000000 325 | m_Automatic: 1 326 | - m_BuildTarget: AppleTVSupport 327 | m_APIs: 10000000 328 | m_Automatic: 1 329 | - m_BuildTarget: WebGLSupport 330 | m_APIs: 0b000000 331 | m_Automatic: 1 332 | m_BuildTargetVRSettings: 333 | - m_BuildTarget: Standalone 334 | m_Enabled: 0 335 | m_Devices: 336 | - Oculus 337 | - OpenVR 338 | openGLRequireES31: 0 339 | openGLRequireES31AEP: 0 340 | openGLRequireES32: 0 341 | m_TemplateCustomTags: {} 342 | mobileMTRendering: 343 | Android: 1 344 | iPhone: 1 345 | tvOS: 1 346 | m_BuildTargetGroupLightmapEncodingQuality: 347 | - m_BuildTarget: Android 348 | m_EncodingQuality: 1 349 | - m_BuildTarget: iPhone 350 | m_EncodingQuality: 1 351 | - m_BuildTarget: tvOS 352 | m_EncodingQuality: 1 353 | m_BuildTargetGroupLightmapSettings: [] 354 | m_BuildTargetNormalMapEncoding: 355 | - m_BuildTarget: Android 356 | m_Encoding: 1 357 | - m_BuildTarget: iPhone 358 | m_Encoding: 1 359 | - m_BuildTarget: tvOS 360 | m_Encoding: 1 361 | m_BuildTargetDefaultTextureCompressionFormat: 362 | - m_BuildTarget: Android 363 | m_Format: 3 364 | playModeTestRunnerEnabled: 0 365 | runPlayModeTestAsEditModeTest: 0 366 | actionOnDotNetUnhandledException: 1 367 | enableInternalProfiler: 0 368 | logObjCUncaughtExceptions: 1 369 | enableCrashReportAPI: 0 370 | cameraUsageDescription: 371 | locationUsageDescription: 372 | microphoneUsageDescription: 373 | bluetoothUsageDescription: 374 | switchNMETAOverride: 375 | switchNetLibKey: 376 | switchSocketMemoryPoolSize: 6144 377 | switchSocketAllocatorPoolSize: 128 378 | switchSocketConcurrencyLimit: 14 379 | switchScreenResolutionBehavior: 2 380 | switchUseCPUProfiler: 0 381 | switchUseGOLDLinker: 0 382 | switchLTOSetting: 0 383 | switchApplicationID: 0x01004b9000490000 384 | switchNSODependencies: 385 | switchTitleNames_0: 386 | switchTitleNames_1: 387 | switchTitleNames_2: 388 | switchTitleNames_3: 389 | switchTitleNames_4: 390 | switchTitleNames_5: 391 | switchTitleNames_6: 392 | switchTitleNames_7: 393 | switchTitleNames_8: 394 | switchTitleNames_9: 395 | switchTitleNames_10: 396 | switchTitleNames_11: 397 | switchTitleNames_12: 398 | switchTitleNames_13: 399 | switchTitleNames_14: 400 | switchTitleNames_15: 401 | switchPublisherNames_0: 402 | switchPublisherNames_1: 403 | switchPublisherNames_2: 404 | switchPublisherNames_3: 405 | switchPublisherNames_4: 406 | switchPublisherNames_5: 407 | switchPublisherNames_6: 408 | switchPublisherNames_7: 409 | switchPublisherNames_8: 410 | switchPublisherNames_9: 411 | switchPublisherNames_10: 412 | switchPublisherNames_11: 413 | switchPublisherNames_12: 414 | switchPublisherNames_13: 415 | switchPublisherNames_14: 416 | switchPublisherNames_15: 417 | switchIcons_0: {fileID: 0} 418 | switchIcons_1: {fileID: 0} 419 | switchIcons_2: {fileID: 0} 420 | switchIcons_3: {fileID: 0} 421 | switchIcons_4: {fileID: 0} 422 | switchIcons_5: {fileID: 0} 423 | switchIcons_6: {fileID: 0} 424 | switchIcons_7: {fileID: 0} 425 | switchIcons_8: {fileID: 0} 426 | switchIcons_9: {fileID: 0} 427 | switchIcons_10: {fileID: 0} 428 | switchIcons_11: {fileID: 0} 429 | switchIcons_12: {fileID: 0} 430 | switchIcons_13: {fileID: 0} 431 | switchIcons_14: {fileID: 0} 432 | switchIcons_15: {fileID: 0} 433 | switchSmallIcons_0: {fileID: 0} 434 | switchSmallIcons_1: {fileID: 0} 435 | switchSmallIcons_2: {fileID: 0} 436 | switchSmallIcons_3: {fileID: 0} 437 | switchSmallIcons_4: {fileID: 0} 438 | switchSmallIcons_5: {fileID: 0} 439 | switchSmallIcons_6: {fileID: 0} 440 | switchSmallIcons_7: {fileID: 0} 441 | switchSmallIcons_8: {fileID: 0} 442 | switchSmallIcons_9: {fileID: 0} 443 | switchSmallIcons_10: {fileID: 0} 444 | switchSmallIcons_11: {fileID: 0} 445 | switchSmallIcons_12: {fileID: 0} 446 | switchSmallIcons_13: {fileID: 0} 447 | switchSmallIcons_14: {fileID: 0} 448 | switchSmallIcons_15: {fileID: 0} 449 | switchManualHTML: 450 | switchAccessibleURLs: 451 | switchLegalInformation: 452 | switchMainThreadStackSize: 1048576 453 | switchPresenceGroupId: 454 | switchLogoHandling: 0 455 | switchReleaseVersion: 0 456 | switchDisplayVersion: 1.0.0 457 | switchStartupUserAccount: 0 458 | switchTouchScreenUsage: 0 459 | switchSupportedLanguagesMask: 0 460 | switchLogoType: 0 461 | switchApplicationErrorCodeCategory: 462 | switchUserAccountSaveDataSize: 0 463 | switchUserAccountSaveDataJournalSize: 0 464 | switchApplicationAttribute: 0 465 | switchCardSpecSize: -1 466 | switchCardSpecClock: -1 467 | switchRatingsMask: 0 468 | switchRatingsInt_0: 0 469 | switchRatingsInt_1: 0 470 | switchRatingsInt_2: 0 471 | switchRatingsInt_3: 0 472 | switchRatingsInt_4: 0 473 | switchRatingsInt_5: 0 474 | switchRatingsInt_6: 0 475 | switchRatingsInt_7: 0 476 | switchRatingsInt_8: 0 477 | switchRatingsInt_9: 0 478 | switchRatingsInt_10: 0 479 | switchRatingsInt_11: 0 480 | switchRatingsInt_12: 0 481 | switchLocalCommunicationIds_0: 482 | switchLocalCommunicationIds_1: 483 | switchLocalCommunicationIds_2: 484 | switchLocalCommunicationIds_3: 485 | switchLocalCommunicationIds_4: 486 | switchLocalCommunicationIds_5: 487 | switchLocalCommunicationIds_6: 488 | switchLocalCommunicationIds_7: 489 | switchParentalControl: 0 490 | switchAllowsScreenshot: 1 491 | switchAllowsVideoCapturing: 1 492 | switchAllowsRuntimeAddOnContentInstall: 0 493 | switchDataLossConfirmation: 0 494 | switchUserAccountLockEnabled: 0 495 | switchSystemResourceMemory: 16777216 496 | switchSupportedNpadStyles: 22 497 | switchNativeFsCacheSize: 32 498 | switchIsHoldTypeHorizontal: 0 499 | switchSupportedNpadCount: 8 500 | switchSocketConfigEnabled: 0 501 | switchTcpInitialSendBufferSize: 32 502 | switchTcpInitialReceiveBufferSize: 64 503 | switchTcpAutoSendBufferSizeMax: 256 504 | switchTcpAutoReceiveBufferSizeMax: 256 505 | switchUdpSendBufferSize: 9 506 | switchUdpReceiveBufferSize: 42 507 | switchSocketBufferEfficiency: 4 508 | switchSocketInitializeEnabled: 1 509 | switchNetworkInterfaceManagerInitializeEnabled: 1 510 | switchPlayerConnectionEnabled: 1 511 | switchUseNewStyleFilepaths: 0 512 | switchUseMicroSleepForYield: 1 513 | switchEnableRamDiskSupport: 0 514 | switchMicroSleepForYieldTime: 25 515 | switchRamDiskSpaceSize: 12 516 | ps4NPAgeRating: 12 517 | ps4NPTitleSecret: 518 | ps4NPTrophyPackPath: 519 | ps4ParentalLevel: 11 520 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 521 | ps4Category: 0 522 | ps4MasterVersion: 01.00 523 | ps4AppVersion: 01.00 524 | ps4AppType: 0 525 | ps4ParamSfxPath: 526 | ps4VideoOutPixelFormat: 0 527 | ps4VideoOutInitialWidth: 1920 528 | ps4VideoOutBaseModeInitialWidth: 1920 529 | ps4VideoOutReprojectionRate: 60 530 | ps4PronunciationXMLPath: 531 | ps4PronunciationSIGPath: 532 | ps4BackgroundImagePath: 533 | ps4StartupImagePath: 534 | ps4StartupImagesFolder: 535 | ps4IconImagesFolder: 536 | ps4SaveDataImagePath: 537 | ps4SdkOverride: 538 | ps4BGMPath: 539 | ps4ShareFilePath: 540 | ps4ShareOverlayImagePath: 541 | ps4PrivacyGuardImagePath: 542 | ps4ExtraSceSysFile: 543 | ps4NPtitleDatPath: 544 | ps4RemotePlayKeyAssignment: -1 545 | ps4RemotePlayKeyMappingDir: 546 | ps4PlayTogetherPlayerCount: 0 547 | ps4EnterButtonAssignment: 1 548 | ps4ApplicationParam1: 0 549 | ps4ApplicationParam2: 0 550 | ps4ApplicationParam3: 0 551 | ps4ApplicationParam4: 0 552 | ps4DownloadDataSize: 0 553 | ps4GarlicHeapSize: 2048 554 | ps4ProGarlicHeapSize: 2560 555 | playerPrefsMaxSize: 32768 556 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 557 | ps4pnSessions: 1 558 | ps4pnPresence: 1 559 | ps4pnFriends: 1 560 | ps4pnGameCustomData: 1 561 | playerPrefsSupport: 0 562 | enableApplicationExit: 0 563 | resetTempFolder: 1 564 | restrictedAudioUsageRights: 0 565 | ps4UseResolutionFallback: 0 566 | ps4ReprojectionSupport: 0 567 | ps4UseAudio3dBackend: 0 568 | ps4UseLowGarlicFragmentationMode: 1 569 | ps4SocialScreenEnabled: 0 570 | ps4ScriptOptimizationLevel: 0 571 | ps4Audio3dVirtualSpeakerCount: 14 572 | ps4attribCpuUsage: 0 573 | ps4PatchPkgPath: 574 | ps4PatchLatestPkgPath: 575 | ps4PatchChangeinfoPath: 576 | ps4PatchDayOne: 0 577 | ps4attribUserManagement: 0 578 | ps4attribMoveSupport: 0 579 | ps4attrib3DSupport: 0 580 | ps4attribShareSupport: 0 581 | ps4attribExclusiveVR: 0 582 | ps4disableAutoHideSplash: 0 583 | ps4videoRecordingFeaturesUsed: 0 584 | ps4contentSearchFeaturesUsed: 0 585 | ps4CompatibilityPS5: 0 586 | ps4GPU800MHz: 1 587 | ps4attribEyeToEyeDistanceSettingVR: 0 588 | ps4IncludedModules: [] 589 | ps4attribVROutputEnabled: 0 590 | monoEnv: 591 | splashScreenBackgroundSourceLandscape: {fileID: 0} 592 | splashScreenBackgroundSourcePortrait: {fileID: 0} 593 | blurSplashScreenBackground: 1 594 | spritePackerPolicy: 595 | webGLMemorySize: 16 596 | webGLExceptionSupport: 1 597 | webGLNameFilesAsHashes: 0 598 | webGLDataCaching: 1 599 | webGLDebugSymbols: 0 600 | webGLEmscriptenArgs: 601 | webGLModulesDirectory: 602 | webGLTemplate: APPLICATION:Default 603 | webGLAnalyzeBuildSize: 0 604 | webGLUseEmbeddedResources: 0 605 | webGLCompressionFormat: 1 606 | webGLWasmArithmeticExceptions: 0 607 | webGLLinkerTarget: 1 608 | webGLThreadsSupport: 0 609 | webGLDecompressionFallback: 0 610 | scriptingDefineSymbols: {} 611 | additionalCompilerArguments: {} 612 | platformArchitecture: {} 613 | scriptingBackend: {} 614 | il2cppCompilerConfiguration: {} 615 | managedStrippingLevel: {} 616 | incrementalIl2cppBuild: {} 617 | suppressCommonWarnings: 1 618 | allowUnsafeCode: 0 619 | useDeterministicCompilation: 1 620 | enableRoslynAnalyzers: 1 621 | additionalIl2CppArgs: 622 | scriptingRuntimeVersion: 1 623 | gcIncremental: 1 624 | assemblyVersionValidation: 1 625 | gcWBarrierValidation: 0 626 | apiCompatibilityLevelPerPlatform: {} 627 | m_RenderingPath: 1 628 | m_MobileRenderingPath: 1 629 | metroPackageName: Template_3D 630 | metroPackageVersion: 631 | metroCertificatePath: 632 | metroCertificatePassword: 633 | metroCertificateSubject: 634 | metroCertificateIssuer: 635 | metroCertificateNotAfter: 0000000000000000 636 | metroApplicationDescription: Template_3D 637 | wsaImages: {} 638 | metroTileShortName: 639 | metroTileShowName: 0 640 | metroMediumTileShowName: 0 641 | metroLargeTileShowName: 0 642 | metroWideTileShowName: 0 643 | metroSupportStreamingInstall: 0 644 | metroLastRequiredScene: 0 645 | metroDefaultTileSize: 1 646 | metroTileForegroundText: 2 647 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 648 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} 649 | metroSplashScreenUseBackgroundColor: 0 650 | platformCapabilities: {} 651 | metroTargetDeviceFamilies: {} 652 | metroFTAName: 653 | metroFTAFileTypes: [] 654 | metroProtocolName: 655 | XboxOneProductId: 656 | XboxOneUpdateKey: 657 | XboxOneSandboxId: 658 | XboxOneContentId: 659 | XboxOneTitleId: 660 | XboxOneSCId: 661 | XboxOneGameOsOverridePath: 662 | XboxOnePackagingOverridePath: 663 | XboxOneAppManifestOverridePath: 664 | XboxOneVersion: 1.0.0.0 665 | XboxOnePackageEncryption: 0 666 | XboxOnePackageUpdateGranularity: 2 667 | XboxOneDescription: 668 | XboxOneLanguage: 669 | - enus 670 | XboxOneCapability: [] 671 | XboxOneGameRating: {} 672 | XboxOneIsContentPackage: 0 673 | XboxOneEnhancedXboxCompatibilityMode: 0 674 | XboxOneEnableGPUVariability: 1 675 | XboxOneSockets: {} 676 | XboxOneSplashScreen: {fileID: 0} 677 | XboxOneAllowedProductIds: [] 678 | XboxOnePersistentLocalStorageSize: 0 679 | XboxOneXTitleMemory: 8 680 | XboxOneOverrideIdentityName: 681 | XboxOneOverrideIdentityPublisher: 682 | vrEditorSettings: {} 683 | cloudServicesEnabled: 684 | UNet: 1 685 | luminIcon: 686 | m_Name: 687 | m_ModelFolderPath: 688 | m_PortalFolderPath: 689 | luminCert: 690 | m_CertPath: 691 | m_SignPackage: 1 692 | luminIsChannelApp: 0 693 | luminVersion: 694 | m_VersionCode: 1 695 | m_VersionName: 696 | apiCompatibilityLevel: 6 697 | activeInputHandler: 0 698 | cloudProjectId: 699 | framebufferDepthMemorylessMode: 0 700 | qualitySettingsNames: [] 701 | projectName: 702 | organizationId: 703 | cloudEnabled: 0 704 | legacyClampBlendShapeWeights: 0 705 | playerDataPath: 706 | forceSRGBBlit: 1 707 | virtualTexturingSupportEnabled: 0 708 | uploadClearedTextureDataAfterCreationFromScript: 1 709 | -------------------------------------------------------------------------------- /Assets/Plugins/UniTask Supplement/UniTask/Scripts/UniTask.WhenAny.Generated.cs: -------------------------------------------------------------------------------- 1 | #if !UNITASK_SUPPLEMENT_DISABLE_WHEN_ANY 2 | using System; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.ExceptionServices; 5 | using System.Threading; 6 | using Cysharp.Threading.Tasks.Internal; 7 | 8 | namespace Cysharp.Threading.Tasks 9 | { 10 | public partial struct UniTask 11 | { 12 | public static async UniTask<(int winArgumentIndex, T result)> WhenAny( 13 | Func> taskFunc1, 14 | Func> taskFunc2, 15 | CancellationToken cancellationToken 16 | ) 17 | { 18 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 19 | (int winArgumentIndex, T result) result = default; 20 | 21 | try 22 | { 23 | result = await WhenAny( 24 | taskFunc1(cts.Token), 25 | taskFunc2(cts.Token) 26 | ); 27 | 28 | cts.Cancel(); 29 | } 30 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 31 | { 32 | if (cancellationToken.IsCancellationRequested) 33 | { 34 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 35 | } 36 | 37 | throw; 38 | } 39 | finally 40 | { 41 | cts.Dispose(); 42 | } 43 | 44 | return result; 45 | } 46 | 47 | public static async UniTask<(int winArgumentIndex, T result)> WhenAny( 48 | Func> taskFunc1, 49 | Func> taskFunc2, 50 | Func> taskFunc3, 51 | CancellationToken cancellationToken 52 | ) 53 | { 54 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 55 | (int winArgumentIndex, T result) result = default; 56 | 57 | try 58 | { 59 | result = await WhenAny( 60 | taskFunc1(cts.Token), 61 | taskFunc2(cts.Token), 62 | taskFunc3(cts.Token) 63 | ); 64 | 65 | cts.Cancel(); 66 | } 67 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 68 | { 69 | if (cancellationToken.IsCancellationRequested) 70 | { 71 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 72 | } 73 | 74 | throw; 75 | } 76 | finally 77 | { 78 | cts.Dispose(); 79 | } 80 | 81 | return result; 82 | } 83 | 84 | public static async UniTask<(int winArgumentIndex, T result)> WhenAny( 85 | Func> taskFunc1, 86 | Func> taskFunc2, 87 | Func> taskFunc3, 88 | Func> taskFunc4, 89 | CancellationToken cancellationToken 90 | ) 91 | { 92 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 93 | (int winArgumentIndex, T result) result = default; 94 | 95 | try 96 | { 97 | result = await WhenAny( 98 | taskFunc1(cts.Token), 99 | taskFunc2(cts.Token), 100 | taskFunc3(cts.Token), 101 | taskFunc4(cts.Token) 102 | ); 103 | 104 | cts.Cancel(); 105 | } 106 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 107 | { 108 | if (cancellationToken.IsCancellationRequested) 109 | { 110 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 111 | } 112 | 113 | throw; 114 | } 115 | finally 116 | { 117 | cts.Dispose(); 118 | } 119 | 120 | return result; 121 | } 122 | 123 | public static async UniTask<(int winArgumentIndex, T result)> WhenAny( 124 | Func> taskFunc1, 125 | Func> taskFunc2, 126 | Func> taskFunc3, 127 | Func> taskFunc4, 128 | Func> taskFunc5, 129 | CancellationToken cancellationToken 130 | ) 131 | { 132 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 133 | (int winArgumentIndex, T result) result = default; 134 | 135 | try 136 | { 137 | result = await WhenAny( 138 | taskFunc1(cts.Token), 139 | taskFunc2(cts.Token), 140 | taskFunc3(cts.Token), 141 | taskFunc4(cts.Token), 142 | taskFunc5(cts.Token) 143 | ); 144 | 145 | cts.Cancel(); 146 | } 147 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 148 | { 149 | if (cancellationToken.IsCancellationRequested) 150 | { 151 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 152 | } 153 | 154 | throw; 155 | } 156 | finally 157 | { 158 | cts.Dispose(); 159 | } 160 | 161 | return result; 162 | } 163 | 164 | public static async UniTask<(int winArgumentIndex, T result)> WhenAny( 165 | Func> taskFunc1, 166 | Func> taskFunc2, 167 | Func> taskFunc3, 168 | Func> taskFunc4, 169 | Func> taskFunc5, 170 | Func> taskFunc6, 171 | CancellationToken cancellationToken 172 | ) 173 | { 174 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 175 | (int winArgumentIndex, T result) result = default; 176 | 177 | try 178 | { 179 | result = await WhenAny( 180 | taskFunc1(cts.Token), 181 | taskFunc2(cts.Token), 182 | taskFunc3(cts.Token), 183 | taskFunc4(cts.Token), 184 | taskFunc5(cts.Token), 185 | taskFunc6(cts.Token) 186 | ); 187 | 188 | cts.Cancel(); 189 | } 190 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 191 | { 192 | if (cancellationToken.IsCancellationRequested) 193 | { 194 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 195 | } 196 | 197 | throw; 198 | } 199 | finally 200 | { 201 | cts.Dispose(); 202 | } 203 | 204 | return result; 205 | } 206 | 207 | public static async UniTask<(int winArgumentIndex, T result)> WhenAny( 208 | Func> taskFunc1, 209 | Func> taskFunc2, 210 | Func> taskFunc3, 211 | Func> taskFunc4, 212 | Func> taskFunc5, 213 | Func> taskFunc6, 214 | Func> taskFunc7, 215 | CancellationToken cancellationToken 216 | ) 217 | { 218 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 219 | (int winArgumentIndex, T result) result = default; 220 | 221 | try 222 | { 223 | result = await WhenAny( 224 | taskFunc1(cts.Token), 225 | taskFunc2(cts.Token), 226 | taskFunc3(cts.Token), 227 | taskFunc4(cts.Token), 228 | taskFunc5(cts.Token), 229 | taskFunc6(cts.Token), 230 | taskFunc7(cts.Token) 231 | ); 232 | 233 | cts.Cancel(); 234 | } 235 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 236 | { 237 | if (cancellationToken.IsCancellationRequested) 238 | { 239 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 240 | } 241 | 242 | throw; 243 | } 244 | finally 245 | { 246 | cts.Dispose(); 247 | } 248 | 249 | return result; 250 | } 251 | 252 | public static async UniTask<(int winArgumentIndex, T result)> WhenAny( 253 | Func> taskFunc1, 254 | Func> taskFunc2, 255 | Func> taskFunc3, 256 | Func> taskFunc4, 257 | Func> taskFunc5, 258 | Func> taskFunc6, 259 | Func> taskFunc7, 260 | Func> taskFunc8, 261 | CancellationToken cancellationToken 262 | ) 263 | { 264 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 265 | (int winArgumentIndex, T result) result = default; 266 | 267 | try 268 | { 269 | result = await WhenAny( 270 | taskFunc1(cts.Token), 271 | taskFunc2(cts.Token), 272 | taskFunc3(cts.Token), 273 | taskFunc4(cts.Token), 274 | taskFunc5(cts.Token), 275 | taskFunc6(cts.Token), 276 | taskFunc7(cts.Token), 277 | taskFunc8(cts.Token) 278 | ); 279 | 280 | cts.Cancel(); 281 | } 282 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 283 | { 284 | if (cancellationToken.IsCancellationRequested) 285 | { 286 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 287 | } 288 | 289 | throw; 290 | } 291 | finally 292 | { 293 | cts.Dispose(); 294 | } 295 | 296 | return result; 297 | } 298 | 299 | public static async UniTask<(int winArgumentIndex, T result)> WhenAny( 300 | Func> taskFunc1, 301 | Func> taskFunc2, 302 | Func> taskFunc3, 303 | Func> taskFunc4, 304 | Func> taskFunc5, 305 | Func> taskFunc6, 306 | Func> taskFunc7, 307 | Func> taskFunc8, 308 | Func> taskFunc9, 309 | CancellationToken cancellationToken 310 | ) 311 | { 312 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 313 | (int winArgumentIndex, T result) result = default; 314 | 315 | try 316 | { 317 | result = await WhenAny( 318 | taskFunc1(cts.Token), 319 | taskFunc2(cts.Token), 320 | taskFunc3(cts.Token), 321 | taskFunc4(cts.Token), 322 | taskFunc5(cts.Token), 323 | taskFunc6(cts.Token), 324 | taskFunc7(cts.Token), 325 | taskFunc8(cts.Token), 326 | taskFunc9(cts.Token) 327 | ); 328 | 329 | cts.Cancel(); 330 | } 331 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 332 | { 333 | if (cancellationToken.IsCancellationRequested) 334 | { 335 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 336 | } 337 | 338 | throw; 339 | } 340 | finally 341 | { 342 | cts.Dispose(); 343 | } 344 | 345 | return result; 346 | } 347 | 348 | public static async UniTask<(int winArgumentIndex, T result)> WhenAny( 349 | Func> taskFunc1, 350 | Func> taskFunc2, 351 | Func> taskFunc3, 352 | Func> taskFunc4, 353 | Func> taskFunc5, 354 | Func> taskFunc6, 355 | Func> taskFunc7, 356 | Func> taskFunc8, 357 | Func> taskFunc9, 358 | Func> taskFunc10, 359 | CancellationToken cancellationToken 360 | ) 361 | { 362 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 363 | (int winArgumentIndex, T result) result = default; 364 | 365 | try 366 | { 367 | result = await WhenAny( 368 | taskFunc1(cts.Token), 369 | taskFunc2(cts.Token), 370 | taskFunc3(cts.Token), 371 | taskFunc4(cts.Token), 372 | taskFunc5(cts.Token), 373 | taskFunc6(cts.Token), 374 | taskFunc7(cts.Token), 375 | taskFunc8(cts.Token), 376 | taskFunc9(cts.Token), 377 | taskFunc10(cts.Token) 378 | ); 379 | 380 | cts.Cancel(); 381 | } 382 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 383 | { 384 | if (cancellationToken.IsCancellationRequested) 385 | { 386 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 387 | } 388 | 389 | throw; 390 | } 391 | finally 392 | { 393 | cts.Dispose(); 394 | } 395 | 396 | return result; 397 | } 398 | 399 | public static async UniTask<(int winArgumentIndex, T result)> WhenAny( 400 | Func> taskFunc1, 401 | Func> taskFunc2, 402 | Func> taskFunc3, 403 | Func> taskFunc4, 404 | Func> taskFunc5, 405 | Func> taskFunc6, 406 | Func> taskFunc7, 407 | Func> taskFunc8, 408 | Func> taskFunc9, 409 | Func> taskFunc10, 410 | Func> taskFunc11, 411 | CancellationToken cancellationToken 412 | ) 413 | { 414 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 415 | (int winArgumentIndex, T result) result = default; 416 | 417 | try 418 | { 419 | result = await WhenAny( 420 | taskFunc1(cts.Token), 421 | taskFunc2(cts.Token), 422 | taskFunc3(cts.Token), 423 | taskFunc4(cts.Token), 424 | taskFunc5(cts.Token), 425 | taskFunc6(cts.Token), 426 | taskFunc7(cts.Token), 427 | taskFunc8(cts.Token), 428 | taskFunc9(cts.Token), 429 | taskFunc10(cts.Token), 430 | taskFunc11(cts.Token) 431 | ); 432 | 433 | cts.Cancel(); 434 | } 435 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 436 | { 437 | if (cancellationToken.IsCancellationRequested) 438 | { 439 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 440 | } 441 | 442 | throw; 443 | } 444 | finally 445 | { 446 | cts.Dispose(); 447 | } 448 | 449 | return result; 450 | } 451 | 452 | public static async UniTask<(int winArgumentIndex, T result)> WhenAny( 453 | Func> taskFunc1, 454 | Func> taskFunc2, 455 | Func> taskFunc3, 456 | Func> taskFunc4, 457 | Func> taskFunc5, 458 | Func> taskFunc6, 459 | Func> taskFunc7, 460 | Func> taskFunc8, 461 | Func> taskFunc9, 462 | Func> taskFunc10, 463 | Func> taskFunc11, 464 | Func> taskFunc12, 465 | CancellationToken cancellationToken 466 | ) 467 | { 468 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 469 | (int winArgumentIndex, T result) result = default; 470 | 471 | try 472 | { 473 | result = await WhenAny( 474 | taskFunc1(cts.Token), 475 | taskFunc2(cts.Token), 476 | taskFunc3(cts.Token), 477 | taskFunc4(cts.Token), 478 | taskFunc5(cts.Token), 479 | taskFunc6(cts.Token), 480 | taskFunc7(cts.Token), 481 | taskFunc8(cts.Token), 482 | taskFunc9(cts.Token), 483 | taskFunc10(cts.Token), 484 | taskFunc11(cts.Token), 485 | taskFunc12(cts.Token) 486 | ); 487 | 488 | cts.Cancel(); 489 | } 490 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 491 | { 492 | if (cancellationToken.IsCancellationRequested) 493 | { 494 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 495 | } 496 | 497 | throw; 498 | } 499 | finally 500 | { 501 | cts.Dispose(); 502 | } 503 | 504 | return result; 505 | } 506 | 507 | public static async UniTask<(int winArgumentIndex, T result)> WhenAny( 508 | Func> taskFunc1, 509 | Func> taskFunc2, 510 | Func> taskFunc3, 511 | Func> taskFunc4, 512 | Func> taskFunc5, 513 | Func> taskFunc6, 514 | Func> taskFunc7, 515 | Func> taskFunc8, 516 | Func> taskFunc9, 517 | Func> taskFunc10, 518 | Func> taskFunc11, 519 | Func> taskFunc12, 520 | Func> taskFunc13, 521 | CancellationToken cancellationToken 522 | ) 523 | { 524 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 525 | (int winArgumentIndex, T result) result = default; 526 | 527 | try 528 | { 529 | result = await WhenAny( 530 | taskFunc1(cts.Token), 531 | taskFunc2(cts.Token), 532 | taskFunc3(cts.Token), 533 | taskFunc4(cts.Token), 534 | taskFunc5(cts.Token), 535 | taskFunc6(cts.Token), 536 | taskFunc7(cts.Token), 537 | taskFunc8(cts.Token), 538 | taskFunc9(cts.Token), 539 | taskFunc10(cts.Token), 540 | taskFunc11(cts.Token), 541 | taskFunc12(cts.Token), 542 | taskFunc13(cts.Token) 543 | ); 544 | 545 | cts.Cancel(); 546 | } 547 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 548 | { 549 | if (cancellationToken.IsCancellationRequested) 550 | { 551 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 552 | } 553 | 554 | throw; 555 | } 556 | finally 557 | { 558 | cts.Dispose(); 559 | } 560 | 561 | return result; 562 | } 563 | 564 | public static async UniTask<(int winArgumentIndex, T result)> WhenAny( 565 | Func> taskFunc1, 566 | Func> taskFunc2, 567 | Func> taskFunc3, 568 | Func> taskFunc4, 569 | Func> taskFunc5, 570 | Func> taskFunc6, 571 | Func> taskFunc7, 572 | Func> taskFunc8, 573 | Func> taskFunc9, 574 | Func> taskFunc10, 575 | Func> taskFunc11, 576 | Func> taskFunc12, 577 | Func> taskFunc13, 578 | Func> taskFunc14, 579 | CancellationToken cancellationToken 580 | ) 581 | { 582 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 583 | (int winArgumentIndex, T result) result = default; 584 | 585 | try 586 | { 587 | result = await WhenAny( 588 | taskFunc1(cts.Token), 589 | taskFunc2(cts.Token), 590 | taskFunc3(cts.Token), 591 | taskFunc4(cts.Token), 592 | taskFunc5(cts.Token), 593 | taskFunc6(cts.Token), 594 | taskFunc7(cts.Token), 595 | taskFunc8(cts.Token), 596 | taskFunc9(cts.Token), 597 | taskFunc10(cts.Token), 598 | taskFunc11(cts.Token), 599 | taskFunc12(cts.Token), 600 | taskFunc13(cts.Token), 601 | taskFunc14(cts.Token) 602 | ); 603 | 604 | cts.Cancel(); 605 | } 606 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 607 | { 608 | if (cancellationToken.IsCancellationRequested) 609 | { 610 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 611 | } 612 | 613 | throw; 614 | } 615 | finally 616 | { 617 | cts.Dispose(); 618 | } 619 | 620 | return result; 621 | } 622 | 623 | public static async UniTask<(int winArgumentIndex, T result)> WhenAny( 624 | Func> taskFunc1, 625 | Func> taskFunc2, 626 | Func> taskFunc3, 627 | Func> taskFunc4, 628 | Func> taskFunc5, 629 | Func> taskFunc6, 630 | Func> taskFunc7, 631 | Func> taskFunc8, 632 | Func> taskFunc9, 633 | Func> taskFunc10, 634 | Func> taskFunc11, 635 | Func> taskFunc12, 636 | Func> taskFunc13, 637 | Func> taskFunc14, 638 | Func> taskFunc15, 639 | CancellationToken cancellationToken 640 | ) 641 | { 642 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 643 | (int winArgumentIndex, T result) result = default; 644 | 645 | try 646 | { 647 | result = await WhenAny( 648 | taskFunc1(cts.Token), 649 | taskFunc2(cts.Token), 650 | taskFunc3(cts.Token), 651 | taskFunc4(cts.Token), 652 | taskFunc5(cts.Token), 653 | taskFunc6(cts.Token), 654 | taskFunc7(cts.Token), 655 | taskFunc8(cts.Token), 656 | taskFunc9(cts.Token), 657 | taskFunc10(cts.Token), 658 | taskFunc11(cts.Token), 659 | taskFunc12(cts.Token), 660 | taskFunc13(cts.Token), 661 | taskFunc14(cts.Token), 662 | taskFunc15(cts.Token) 663 | ); 664 | 665 | cts.Cancel(); 666 | } 667 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 668 | { 669 | if (cancellationToken.IsCancellationRequested) 670 | { 671 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 672 | } 673 | 674 | throw; 675 | } 676 | finally 677 | { 678 | cts.Dispose(); 679 | } 680 | 681 | return result; 682 | } 683 | 684 | /// Return value is winArgumentIndex 685 | public static async UniTask WhenAny( 686 | Func taskFunc1, 687 | Func taskFunc2, 688 | CancellationToken cancellationToken 689 | ) 690 | { 691 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 692 | int winArgumentIndex = default; 693 | 694 | try 695 | { 696 | winArgumentIndex = await WhenAny( 697 | taskFunc1(cts.Token), 698 | taskFunc2(cts.Token) 699 | ); 700 | 701 | cts.Cancel(); 702 | } 703 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 704 | { 705 | if (cancellationToken.IsCancellationRequested) 706 | { 707 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 708 | } 709 | 710 | throw; 711 | } 712 | finally 713 | { 714 | cts.Dispose(); 715 | } 716 | 717 | return winArgumentIndex; 718 | } 719 | 720 | /// Return value is winArgumentIndex 721 | public static async UniTask WhenAny( 722 | Func taskFunc1, 723 | Func taskFunc2, 724 | Func taskFunc3, 725 | CancellationToken cancellationToken 726 | ) 727 | { 728 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 729 | int winArgumentIndex = default; 730 | 731 | try 732 | { 733 | winArgumentIndex = await WhenAny( 734 | taskFunc1(cts.Token), 735 | taskFunc2(cts.Token), 736 | taskFunc3(cts.Token) 737 | ); 738 | 739 | cts.Cancel(); 740 | } 741 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 742 | { 743 | if (cancellationToken.IsCancellationRequested) 744 | { 745 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 746 | } 747 | 748 | throw; 749 | } 750 | finally 751 | { 752 | cts.Dispose(); 753 | } 754 | 755 | return winArgumentIndex; 756 | } 757 | 758 | /// Return value is winArgumentIndex 759 | public static async UniTask WhenAny( 760 | Func taskFunc1, 761 | Func taskFunc2, 762 | Func taskFunc3, 763 | Func taskFunc4, 764 | CancellationToken cancellationToken 765 | ) 766 | { 767 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 768 | int winArgumentIndex = default; 769 | 770 | try 771 | { 772 | winArgumentIndex = await WhenAny( 773 | taskFunc1(cts.Token), 774 | taskFunc2(cts.Token), 775 | taskFunc3(cts.Token), 776 | taskFunc4(cts.Token) 777 | ); 778 | 779 | cts.Cancel(); 780 | } 781 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 782 | { 783 | if (cancellationToken.IsCancellationRequested) 784 | { 785 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 786 | } 787 | 788 | throw; 789 | } 790 | finally 791 | { 792 | cts.Dispose(); 793 | } 794 | 795 | return winArgumentIndex; 796 | } 797 | 798 | /// Return value is winArgumentIndex 799 | public static async UniTask WhenAny( 800 | Func taskFunc1, 801 | Func taskFunc2, 802 | Func taskFunc3, 803 | Func taskFunc4, 804 | Func taskFunc5, 805 | CancellationToken cancellationToken 806 | ) 807 | { 808 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 809 | int winArgumentIndex = default; 810 | 811 | try 812 | { 813 | winArgumentIndex = await WhenAny( 814 | taskFunc1(cts.Token), 815 | taskFunc2(cts.Token), 816 | taskFunc3(cts.Token), 817 | taskFunc4(cts.Token), 818 | taskFunc5(cts.Token) 819 | ); 820 | 821 | cts.Cancel(); 822 | } 823 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 824 | { 825 | if (cancellationToken.IsCancellationRequested) 826 | { 827 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 828 | } 829 | 830 | throw; 831 | } 832 | finally 833 | { 834 | cts.Dispose(); 835 | } 836 | 837 | return winArgumentIndex; 838 | } 839 | 840 | /// Return value is winArgumentIndex 841 | public static async UniTask WhenAny( 842 | Func taskFunc1, 843 | Func taskFunc2, 844 | Func taskFunc3, 845 | Func taskFunc4, 846 | Func taskFunc5, 847 | Func taskFunc6, 848 | CancellationToken cancellationToken 849 | ) 850 | { 851 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 852 | int winArgumentIndex = default; 853 | 854 | try 855 | { 856 | winArgumentIndex = await WhenAny( 857 | taskFunc1(cts.Token), 858 | taskFunc2(cts.Token), 859 | taskFunc3(cts.Token), 860 | taskFunc4(cts.Token), 861 | taskFunc5(cts.Token), 862 | taskFunc6(cts.Token) 863 | ); 864 | 865 | cts.Cancel(); 866 | } 867 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 868 | { 869 | if (cancellationToken.IsCancellationRequested) 870 | { 871 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 872 | } 873 | 874 | throw; 875 | } 876 | finally 877 | { 878 | cts.Dispose(); 879 | } 880 | 881 | return winArgumentIndex; 882 | } 883 | 884 | /// Return value is winArgumentIndex 885 | public static async UniTask WhenAny( 886 | Func taskFunc1, 887 | Func taskFunc2, 888 | Func taskFunc3, 889 | Func taskFunc4, 890 | Func taskFunc5, 891 | Func taskFunc6, 892 | Func taskFunc7, 893 | CancellationToken cancellationToken 894 | ) 895 | { 896 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 897 | int winArgumentIndex = default; 898 | 899 | try 900 | { 901 | winArgumentIndex = await WhenAny( 902 | taskFunc1(cts.Token), 903 | taskFunc2(cts.Token), 904 | taskFunc3(cts.Token), 905 | taskFunc4(cts.Token), 906 | taskFunc5(cts.Token), 907 | taskFunc6(cts.Token), 908 | taskFunc7(cts.Token) 909 | ); 910 | 911 | cts.Cancel(); 912 | } 913 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 914 | { 915 | if (cancellationToken.IsCancellationRequested) 916 | { 917 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 918 | } 919 | 920 | throw; 921 | } 922 | finally 923 | { 924 | cts.Dispose(); 925 | } 926 | 927 | return winArgumentIndex; 928 | } 929 | 930 | /// Return value is winArgumentIndex 931 | public static async UniTask WhenAny( 932 | Func taskFunc1, 933 | Func taskFunc2, 934 | Func taskFunc3, 935 | Func taskFunc4, 936 | Func taskFunc5, 937 | Func taskFunc6, 938 | Func taskFunc7, 939 | Func taskFunc8, 940 | CancellationToken cancellationToken 941 | ) 942 | { 943 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 944 | int winArgumentIndex = default; 945 | 946 | try 947 | { 948 | winArgumentIndex = await WhenAny( 949 | taskFunc1(cts.Token), 950 | taskFunc2(cts.Token), 951 | taskFunc3(cts.Token), 952 | taskFunc4(cts.Token), 953 | taskFunc5(cts.Token), 954 | taskFunc6(cts.Token), 955 | taskFunc7(cts.Token), 956 | taskFunc8(cts.Token) 957 | ); 958 | 959 | cts.Cancel(); 960 | } 961 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 962 | { 963 | if (cancellationToken.IsCancellationRequested) 964 | { 965 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 966 | } 967 | 968 | throw; 969 | } 970 | finally 971 | { 972 | cts.Dispose(); 973 | } 974 | 975 | return winArgumentIndex; 976 | } 977 | 978 | /// Return value is winArgumentIndex 979 | public static async UniTask WhenAny( 980 | Func taskFunc1, 981 | Func taskFunc2, 982 | Func taskFunc3, 983 | Func taskFunc4, 984 | Func taskFunc5, 985 | Func taskFunc6, 986 | Func taskFunc7, 987 | Func taskFunc8, 988 | Func taskFunc9, 989 | CancellationToken cancellationToken 990 | ) 991 | { 992 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 993 | int winArgumentIndex = default; 994 | 995 | try 996 | { 997 | winArgumentIndex = await WhenAny( 998 | taskFunc1(cts.Token), 999 | taskFunc2(cts.Token), 1000 | taskFunc3(cts.Token), 1001 | taskFunc4(cts.Token), 1002 | taskFunc5(cts.Token), 1003 | taskFunc6(cts.Token), 1004 | taskFunc7(cts.Token), 1005 | taskFunc8(cts.Token), 1006 | taskFunc9(cts.Token) 1007 | ); 1008 | 1009 | cts.Cancel(); 1010 | } 1011 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1012 | { 1013 | if (cancellationToken.IsCancellationRequested) 1014 | { 1015 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1016 | } 1017 | 1018 | throw; 1019 | } 1020 | finally 1021 | { 1022 | cts.Dispose(); 1023 | } 1024 | 1025 | return winArgumentIndex; 1026 | } 1027 | 1028 | /// Return value is winArgumentIndex 1029 | public static async UniTask WhenAny( 1030 | Func taskFunc1, 1031 | Func taskFunc2, 1032 | Func taskFunc3, 1033 | Func taskFunc4, 1034 | Func taskFunc5, 1035 | Func taskFunc6, 1036 | Func taskFunc7, 1037 | Func taskFunc8, 1038 | Func taskFunc9, 1039 | Func taskFunc10, 1040 | CancellationToken cancellationToken 1041 | ) 1042 | { 1043 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1044 | int winArgumentIndex = default; 1045 | 1046 | try 1047 | { 1048 | winArgumentIndex = await WhenAny( 1049 | taskFunc1(cts.Token), 1050 | taskFunc2(cts.Token), 1051 | taskFunc3(cts.Token), 1052 | taskFunc4(cts.Token), 1053 | taskFunc5(cts.Token), 1054 | taskFunc6(cts.Token), 1055 | taskFunc7(cts.Token), 1056 | taskFunc8(cts.Token), 1057 | taskFunc9(cts.Token), 1058 | taskFunc10(cts.Token) 1059 | ); 1060 | 1061 | cts.Cancel(); 1062 | } 1063 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1064 | { 1065 | if (cancellationToken.IsCancellationRequested) 1066 | { 1067 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1068 | } 1069 | 1070 | throw; 1071 | } 1072 | finally 1073 | { 1074 | cts.Dispose(); 1075 | } 1076 | 1077 | return winArgumentIndex; 1078 | } 1079 | 1080 | /// Return value is winArgumentIndex 1081 | public static async UniTask WhenAny( 1082 | Func taskFunc1, 1083 | Func taskFunc2, 1084 | Func taskFunc3, 1085 | Func taskFunc4, 1086 | Func taskFunc5, 1087 | Func taskFunc6, 1088 | Func taskFunc7, 1089 | Func taskFunc8, 1090 | Func taskFunc9, 1091 | Func taskFunc10, 1092 | Func taskFunc11, 1093 | CancellationToken cancellationToken 1094 | ) 1095 | { 1096 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1097 | int winArgumentIndex = default; 1098 | 1099 | try 1100 | { 1101 | winArgumentIndex = await WhenAny( 1102 | taskFunc1(cts.Token), 1103 | taskFunc2(cts.Token), 1104 | taskFunc3(cts.Token), 1105 | taskFunc4(cts.Token), 1106 | taskFunc5(cts.Token), 1107 | taskFunc6(cts.Token), 1108 | taskFunc7(cts.Token), 1109 | taskFunc8(cts.Token), 1110 | taskFunc9(cts.Token), 1111 | taskFunc10(cts.Token), 1112 | taskFunc11(cts.Token) 1113 | ); 1114 | 1115 | cts.Cancel(); 1116 | } 1117 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1118 | { 1119 | if (cancellationToken.IsCancellationRequested) 1120 | { 1121 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1122 | } 1123 | 1124 | throw; 1125 | } 1126 | finally 1127 | { 1128 | cts.Dispose(); 1129 | } 1130 | 1131 | return winArgumentIndex; 1132 | } 1133 | 1134 | /// Return value is winArgumentIndex 1135 | public static async UniTask WhenAny( 1136 | Func taskFunc1, 1137 | Func taskFunc2, 1138 | Func taskFunc3, 1139 | Func taskFunc4, 1140 | Func taskFunc5, 1141 | Func taskFunc6, 1142 | Func taskFunc7, 1143 | Func taskFunc8, 1144 | Func taskFunc9, 1145 | Func taskFunc10, 1146 | Func taskFunc11, 1147 | Func taskFunc12, 1148 | CancellationToken cancellationToken 1149 | ) 1150 | { 1151 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1152 | int winArgumentIndex = default; 1153 | 1154 | try 1155 | { 1156 | winArgumentIndex = await WhenAny( 1157 | taskFunc1(cts.Token), 1158 | taskFunc2(cts.Token), 1159 | taskFunc3(cts.Token), 1160 | taskFunc4(cts.Token), 1161 | taskFunc5(cts.Token), 1162 | taskFunc6(cts.Token), 1163 | taskFunc7(cts.Token), 1164 | taskFunc8(cts.Token), 1165 | taskFunc9(cts.Token), 1166 | taskFunc10(cts.Token), 1167 | taskFunc11(cts.Token), 1168 | taskFunc12(cts.Token) 1169 | ); 1170 | 1171 | cts.Cancel(); 1172 | } 1173 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1174 | { 1175 | if (cancellationToken.IsCancellationRequested) 1176 | { 1177 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1178 | } 1179 | 1180 | throw; 1181 | } 1182 | finally 1183 | { 1184 | cts.Dispose(); 1185 | } 1186 | 1187 | return winArgumentIndex; 1188 | } 1189 | 1190 | /// Return value is winArgumentIndex 1191 | public static async UniTask WhenAny( 1192 | Func taskFunc1, 1193 | Func taskFunc2, 1194 | Func taskFunc3, 1195 | Func taskFunc4, 1196 | Func taskFunc5, 1197 | Func taskFunc6, 1198 | Func taskFunc7, 1199 | Func taskFunc8, 1200 | Func taskFunc9, 1201 | Func taskFunc10, 1202 | Func taskFunc11, 1203 | Func taskFunc12, 1204 | Func taskFunc13, 1205 | CancellationToken cancellationToken 1206 | ) 1207 | { 1208 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1209 | int winArgumentIndex = default; 1210 | 1211 | try 1212 | { 1213 | winArgumentIndex = await WhenAny( 1214 | taskFunc1(cts.Token), 1215 | taskFunc2(cts.Token), 1216 | taskFunc3(cts.Token), 1217 | taskFunc4(cts.Token), 1218 | taskFunc5(cts.Token), 1219 | taskFunc6(cts.Token), 1220 | taskFunc7(cts.Token), 1221 | taskFunc8(cts.Token), 1222 | taskFunc9(cts.Token), 1223 | taskFunc10(cts.Token), 1224 | taskFunc11(cts.Token), 1225 | taskFunc12(cts.Token), 1226 | taskFunc13(cts.Token) 1227 | ); 1228 | 1229 | cts.Cancel(); 1230 | } 1231 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1232 | { 1233 | if (cancellationToken.IsCancellationRequested) 1234 | { 1235 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1236 | } 1237 | 1238 | throw; 1239 | } 1240 | finally 1241 | { 1242 | cts.Dispose(); 1243 | } 1244 | 1245 | return winArgumentIndex; 1246 | } 1247 | 1248 | /// Return value is winArgumentIndex 1249 | public static async UniTask WhenAny( 1250 | Func taskFunc1, 1251 | Func taskFunc2, 1252 | Func taskFunc3, 1253 | Func taskFunc4, 1254 | Func taskFunc5, 1255 | Func taskFunc6, 1256 | Func taskFunc7, 1257 | Func taskFunc8, 1258 | Func taskFunc9, 1259 | Func taskFunc10, 1260 | Func taskFunc11, 1261 | Func taskFunc12, 1262 | Func taskFunc13, 1263 | Func taskFunc14, 1264 | CancellationToken cancellationToken 1265 | ) 1266 | { 1267 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1268 | int winArgumentIndex = default; 1269 | 1270 | try 1271 | { 1272 | winArgumentIndex = await WhenAny( 1273 | taskFunc1(cts.Token), 1274 | taskFunc2(cts.Token), 1275 | taskFunc3(cts.Token), 1276 | taskFunc4(cts.Token), 1277 | taskFunc5(cts.Token), 1278 | taskFunc6(cts.Token), 1279 | taskFunc7(cts.Token), 1280 | taskFunc8(cts.Token), 1281 | taskFunc9(cts.Token), 1282 | taskFunc10(cts.Token), 1283 | taskFunc11(cts.Token), 1284 | taskFunc12(cts.Token), 1285 | taskFunc13(cts.Token), 1286 | taskFunc14(cts.Token) 1287 | ); 1288 | 1289 | cts.Cancel(); 1290 | } 1291 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1292 | { 1293 | if (cancellationToken.IsCancellationRequested) 1294 | { 1295 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1296 | } 1297 | 1298 | throw; 1299 | } 1300 | finally 1301 | { 1302 | cts.Dispose(); 1303 | } 1304 | 1305 | return winArgumentIndex; 1306 | } 1307 | 1308 | /// Return value is winArgumentIndex 1309 | public static async UniTask WhenAny( 1310 | Func taskFunc1, 1311 | Func taskFunc2, 1312 | Func taskFunc3, 1313 | Func taskFunc4, 1314 | Func taskFunc5, 1315 | Func taskFunc6, 1316 | Func taskFunc7, 1317 | Func taskFunc8, 1318 | Func taskFunc9, 1319 | Func taskFunc10, 1320 | Func taskFunc11, 1321 | Func taskFunc12, 1322 | Func taskFunc13, 1323 | Func taskFunc14, 1324 | Func taskFunc15, 1325 | CancellationToken cancellationToken 1326 | ) 1327 | { 1328 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1329 | int winArgumentIndex = default; 1330 | 1331 | try 1332 | { 1333 | winArgumentIndex = await WhenAny( 1334 | taskFunc1(cts.Token), 1335 | taskFunc2(cts.Token), 1336 | taskFunc3(cts.Token), 1337 | taskFunc4(cts.Token), 1338 | taskFunc5(cts.Token), 1339 | taskFunc6(cts.Token), 1340 | taskFunc7(cts.Token), 1341 | taskFunc8(cts.Token), 1342 | taskFunc9(cts.Token), 1343 | taskFunc10(cts.Token), 1344 | taskFunc11(cts.Token), 1345 | taskFunc12(cts.Token), 1346 | taskFunc13(cts.Token), 1347 | taskFunc14(cts.Token), 1348 | taskFunc15(cts.Token) 1349 | ); 1350 | 1351 | cts.Cancel(); 1352 | } 1353 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1354 | { 1355 | if (cancellationToken.IsCancellationRequested) 1356 | { 1357 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1358 | } 1359 | 1360 | throw; 1361 | } 1362 | finally 1363 | { 1364 | cts.Dispose(); 1365 | } 1366 | 1367 | return winArgumentIndex; 1368 | } 1369 | 1370 | public static async UniTask<(int winArgumentIndex, T1 result1, T2 result2)> WhenAny(Func> taskFunc1, Func> taskFunc2, CancellationToken cancellationToken) 1371 | { 1372 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1373 | (int winArgumentIndex, T1 result1, T2 result2) result = default; 1374 | 1375 | try 1376 | { 1377 | result = await WhenAny( 1378 | taskFunc1(cts.Token), 1379 | taskFunc2(cts.Token) 1380 | ); 1381 | 1382 | cts.Cancel(); 1383 | } 1384 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1385 | { 1386 | if (cancellationToken.IsCancellationRequested) 1387 | { 1388 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1389 | } 1390 | 1391 | throw; 1392 | } 1393 | finally 1394 | { 1395 | cts.Dispose(); 1396 | } 1397 | 1398 | return result; 1399 | } 1400 | 1401 | public static async UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3)> WhenAny(Func> taskFunc1, Func> taskFunc2, Func> taskFunc3, CancellationToken cancellationToken) 1402 | { 1403 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1404 | (int winArgumentIndex, T1 result1, T2 result2, T3 result3) result = default; 1405 | 1406 | try 1407 | { 1408 | result = await WhenAny( 1409 | taskFunc1(cts.Token), 1410 | taskFunc2(cts.Token), 1411 | taskFunc3(cts.Token) 1412 | ); 1413 | 1414 | cts.Cancel(); 1415 | } 1416 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1417 | { 1418 | if (cancellationToken.IsCancellationRequested) 1419 | { 1420 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1421 | } 1422 | 1423 | throw; 1424 | } 1425 | finally 1426 | { 1427 | cts.Dispose(); 1428 | } 1429 | 1430 | return result; 1431 | } 1432 | 1433 | public static async UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4)> WhenAny(Func> taskFunc1, Func> taskFunc2, Func> taskFunc3, Func> taskFunc4, CancellationToken cancellationToken) 1434 | { 1435 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1436 | (int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4) result = default; 1437 | 1438 | try 1439 | { 1440 | result = await WhenAny( 1441 | taskFunc1(cts.Token), 1442 | taskFunc2(cts.Token), 1443 | taskFunc3(cts.Token), 1444 | taskFunc4(cts.Token) 1445 | ); 1446 | 1447 | cts.Cancel(); 1448 | } 1449 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1450 | { 1451 | if (cancellationToken.IsCancellationRequested) 1452 | { 1453 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1454 | } 1455 | 1456 | throw; 1457 | } 1458 | finally 1459 | { 1460 | cts.Dispose(); 1461 | } 1462 | 1463 | return result; 1464 | } 1465 | 1466 | public static async UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5)> WhenAny(Func> taskFunc1, Func> taskFunc2, Func> taskFunc3, Func> taskFunc4, Func> taskFunc5, CancellationToken cancellationToken) 1467 | { 1468 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1469 | (int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5) result = default; 1470 | 1471 | try 1472 | { 1473 | result = await WhenAny( 1474 | taskFunc1(cts.Token), 1475 | taskFunc2(cts.Token), 1476 | taskFunc3(cts.Token), 1477 | taskFunc4(cts.Token), 1478 | taskFunc5(cts.Token) 1479 | ); 1480 | 1481 | cts.Cancel(); 1482 | } 1483 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1484 | { 1485 | if (cancellationToken.IsCancellationRequested) 1486 | { 1487 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1488 | } 1489 | 1490 | throw; 1491 | } 1492 | finally 1493 | { 1494 | cts.Dispose(); 1495 | } 1496 | 1497 | return result; 1498 | } 1499 | 1500 | public static async UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6)> WhenAny(Func> taskFunc1, Func> taskFunc2, Func> taskFunc3, Func> taskFunc4, Func> taskFunc5, Func> taskFunc6, CancellationToken cancellationToken) 1501 | { 1502 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1503 | (int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6) result = default; 1504 | 1505 | try 1506 | { 1507 | result = await WhenAny( 1508 | taskFunc1(cts.Token), 1509 | taskFunc2(cts.Token), 1510 | taskFunc3(cts.Token), 1511 | taskFunc4(cts.Token), 1512 | taskFunc5(cts.Token), 1513 | taskFunc6(cts.Token) 1514 | ); 1515 | 1516 | cts.Cancel(); 1517 | } 1518 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1519 | { 1520 | if (cancellationToken.IsCancellationRequested) 1521 | { 1522 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1523 | } 1524 | 1525 | throw; 1526 | } 1527 | finally 1528 | { 1529 | cts.Dispose(); 1530 | } 1531 | 1532 | return result; 1533 | } 1534 | 1535 | public static async UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7)> WhenAny(Func> taskFunc1, Func> taskFunc2, Func> taskFunc3, Func> taskFunc4, Func> taskFunc5, Func> taskFunc6, Func> taskFunc7, CancellationToken cancellationToken) 1536 | { 1537 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1538 | (int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7) result = default; 1539 | 1540 | try 1541 | { 1542 | result = await WhenAny( 1543 | taskFunc1(cts.Token), 1544 | taskFunc2(cts.Token), 1545 | taskFunc3(cts.Token), 1546 | taskFunc4(cts.Token), 1547 | taskFunc5(cts.Token), 1548 | taskFunc6(cts.Token), 1549 | taskFunc7(cts.Token) 1550 | ); 1551 | 1552 | cts.Cancel(); 1553 | } 1554 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1555 | { 1556 | if (cancellationToken.IsCancellationRequested) 1557 | { 1558 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1559 | } 1560 | 1561 | throw; 1562 | } 1563 | finally 1564 | { 1565 | cts.Dispose(); 1566 | } 1567 | 1568 | return result; 1569 | } 1570 | 1571 | public static async UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8)> WhenAny(Func> taskFunc1, Func> taskFunc2, Func> taskFunc3, Func> taskFunc4, Func> taskFunc5, Func> taskFunc6, Func> taskFunc7, Func> taskFunc8, CancellationToken cancellationToken) 1572 | { 1573 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1574 | (int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8) result = default; 1575 | 1576 | try 1577 | { 1578 | result = await WhenAny( 1579 | taskFunc1(cts.Token), 1580 | taskFunc2(cts.Token), 1581 | taskFunc3(cts.Token), 1582 | taskFunc4(cts.Token), 1583 | taskFunc5(cts.Token), 1584 | taskFunc6(cts.Token), 1585 | taskFunc7(cts.Token), 1586 | taskFunc8(cts.Token) 1587 | ); 1588 | 1589 | cts.Cancel(); 1590 | } 1591 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1592 | { 1593 | if (cancellationToken.IsCancellationRequested) 1594 | { 1595 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1596 | } 1597 | 1598 | throw; 1599 | } 1600 | finally 1601 | { 1602 | cts.Dispose(); 1603 | } 1604 | 1605 | return result; 1606 | } 1607 | 1608 | public static async UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9)> WhenAny(Func> taskFunc1, Func> taskFunc2, Func> taskFunc3, Func> taskFunc4, Func> taskFunc5, Func> taskFunc6, Func> taskFunc7, Func> taskFunc8, Func> taskFunc9, CancellationToken cancellationToken) 1609 | { 1610 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1611 | (int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9) result = default; 1612 | 1613 | try 1614 | { 1615 | result = await WhenAny( 1616 | taskFunc1(cts.Token), 1617 | taskFunc2(cts.Token), 1618 | taskFunc3(cts.Token), 1619 | taskFunc4(cts.Token), 1620 | taskFunc5(cts.Token), 1621 | taskFunc6(cts.Token), 1622 | taskFunc7(cts.Token), 1623 | taskFunc8(cts.Token), 1624 | taskFunc9(cts.Token) 1625 | ); 1626 | 1627 | cts.Cancel(); 1628 | } 1629 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1630 | { 1631 | if (cancellationToken.IsCancellationRequested) 1632 | { 1633 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1634 | } 1635 | 1636 | throw; 1637 | } 1638 | finally 1639 | { 1640 | cts.Dispose(); 1641 | } 1642 | 1643 | return result; 1644 | } 1645 | 1646 | public static async UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10)> WhenAny(Func> taskFunc1, Func> taskFunc2, Func> taskFunc3, Func> taskFunc4, Func> taskFunc5, Func> taskFunc6, Func> taskFunc7, Func> taskFunc8, Func> taskFunc9, Func> taskFunc10, CancellationToken cancellationToken) 1647 | { 1648 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1649 | (int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10) result = default; 1650 | 1651 | try 1652 | { 1653 | result = await WhenAny( 1654 | taskFunc1(cts.Token), 1655 | taskFunc2(cts.Token), 1656 | taskFunc3(cts.Token), 1657 | taskFunc4(cts.Token), 1658 | taskFunc5(cts.Token), 1659 | taskFunc6(cts.Token), 1660 | taskFunc7(cts.Token), 1661 | taskFunc8(cts.Token), 1662 | taskFunc9(cts.Token), 1663 | taskFunc10(cts.Token) 1664 | ); 1665 | 1666 | cts.Cancel(); 1667 | } 1668 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1669 | { 1670 | if (cancellationToken.IsCancellationRequested) 1671 | { 1672 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1673 | } 1674 | 1675 | throw; 1676 | } 1677 | finally 1678 | { 1679 | cts.Dispose(); 1680 | } 1681 | 1682 | return result; 1683 | } 1684 | 1685 | public static async UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11)> WhenAny(Func> taskFunc1, Func> taskFunc2, Func> taskFunc3, Func> taskFunc4, Func> taskFunc5, Func> taskFunc6, Func> taskFunc7, Func> taskFunc8, Func> taskFunc9, Func> taskFunc10, Func> taskFunc11, CancellationToken cancellationToken) 1686 | { 1687 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1688 | (int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11) result = default; 1689 | 1690 | try 1691 | { 1692 | result = await WhenAny( 1693 | taskFunc1(cts.Token), 1694 | taskFunc2(cts.Token), 1695 | taskFunc3(cts.Token), 1696 | taskFunc4(cts.Token), 1697 | taskFunc5(cts.Token), 1698 | taskFunc6(cts.Token), 1699 | taskFunc7(cts.Token), 1700 | taskFunc8(cts.Token), 1701 | taskFunc9(cts.Token), 1702 | taskFunc10(cts.Token), 1703 | taskFunc11(cts.Token) 1704 | ); 1705 | 1706 | cts.Cancel(); 1707 | } 1708 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1709 | { 1710 | if (cancellationToken.IsCancellationRequested) 1711 | { 1712 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1713 | } 1714 | 1715 | throw; 1716 | } 1717 | finally 1718 | { 1719 | cts.Dispose(); 1720 | } 1721 | 1722 | return result; 1723 | } 1724 | 1725 | public static async UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12)> WhenAny(Func> taskFunc1, Func> taskFunc2, Func> taskFunc3, Func> taskFunc4, Func> taskFunc5, Func> taskFunc6, Func> taskFunc7, Func> taskFunc8, Func> taskFunc9, Func> taskFunc10, Func> taskFunc11, Func> taskFunc12, CancellationToken cancellationToken) 1726 | { 1727 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1728 | (int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12) result = default; 1729 | 1730 | try 1731 | { 1732 | result = await WhenAny( 1733 | taskFunc1(cts.Token), 1734 | taskFunc2(cts.Token), 1735 | taskFunc3(cts.Token), 1736 | taskFunc4(cts.Token), 1737 | taskFunc5(cts.Token), 1738 | taskFunc6(cts.Token), 1739 | taskFunc7(cts.Token), 1740 | taskFunc8(cts.Token), 1741 | taskFunc9(cts.Token), 1742 | taskFunc10(cts.Token), 1743 | taskFunc11(cts.Token), 1744 | taskFunc12(cts.Token) 1745 | ); 1746 | 1747 | cts.Cancel(); 1748 | } 1749 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1750 | { 1751 | if (cancellationToken.IsCancellationRequested) 1752 | { 1753 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1754 | } 1755 | 1756 | throw; 1757 | } 1758 | finally 1759 | { 1760 | cts.Dispose(); 1761 | } 1762 | 1763 | return result; 1764 | } 1765 | 1766 | public static async UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13)> WhenAny(Func> taskFunc1, Func> taskFunc2, Func> taskFunc3, Func> taskFunc4, Func> taskFunc5, Func> taskFunc6, Func> taskFunc7, Func> taskFunc8, Func> taskFunc9, Func> taskFunc10, Func> taskFunc11, Func> taskFunc12, Func> taskFunc13, CancellationToken cancellationToken) 1767 | { 1768 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1769 | (int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13) result = default; 1770 | 1771 | try 1772 | { 1773 | result = await WhenAny( 1774 | taskFunc1(cts.Token), 1775 | taskFunc2(cts.Token), 1776 | taskFunc3(cts.Token), 1777 | taskFunc4(cts.Token), 1778 | taskFunc5(cts.Token), 1779 | taskFunc6(cts.Token), 1780 | taskFunc7(cts.Token), 1781 | taskFunc8(cts.Token), 1782 | taskFunc9(cts.Token), 1783 | taskFunc10(cts.Token), 1784 | taskFunc11(cts.Token), 1785 | taskFunc12(cts.Token), 1786 | taskFunc13(cts.Token) 1787 | ); 1788 | 1789 | cts.Cancel(); 1790 | } 1791 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1792 | { 1793 | if (cancellationToken.IsCancellationRequested) 1794 | { 1795 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1796 | } 1797 | 1798 | throw; 1799 | } 1800 | finally 1801 | { 1802 | cts.Dispose(); 1803 | } 1804 | 1805 | return result; 1806 | } 1807 | 1808 | public static async UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14)> WhenAny(Func> taskFunc1, Func> taskFunc2, Func> taskFunc3, Func> taskFunc4, Func> taskFunc5, Func> taskFunc6, Func> taskFunc7, Func> taskFunc8, Func> taskFunc9, Func> taskFunc10, Func> taskFunc11, Func> taskFunc12, Func> taskFunc13, Func> taskFunc14, CancellationToken cancellationToken) 1809 | { 1810 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1811 | (int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14) result = default; 1812 | 1813 | try 1814 | { 1815 | result = await WhenAny( 1816 | taskFunc1(cts.Token), 1817 | taskFunc2(cts.Token), 1818 | taskFunc3(cts.Token), 1819 | taskFunc4(cts.Token), 1820 | taskFunc5(cts.Token), 1821 | taskFunc6(cts.Token), 1822 | taskFunc7(cts.Token), 1823 | taskFunc8(cts.Token), 1824 | taskFunc9(cts.Token), 1825 | taskFunc10(cts.Token), 1826 | taskFunc11(cts.Token), 1827 | taskFunc12(cts.Token), 1828 | taskFunc13(cts.Token), 1829 | taskFunc14(cts.Token) 1830 | ); 1831 | 1832 | cts.Cancel(); 1833 | } 1834 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1835 | { 1836 | if (cancellationToken.IsCancellationRequested) 1837 | { 1838 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1839 | } 1840 | 1841 | throw; 1842 | } 1843 | finally 1844 | { 1845 | cts.Dispose(); 1846 | } 1847 | 1848 | return result; 1849 | } 1850 | 1851 | public static async UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14, T15 result15)> WhenAny(Func> taskFunc1, Func> taskFunc2, Func> taskFunc3, Func> taskFunc4, Func> taskFunc5, Func> taskFunc6, Func> taskFunc7, Func> taskFunc8, Func> taskFunc9, Func> taskFunc10, Func> taskFunc11, Func> taskFunc12, Func> taskFunc13, Func> taskFunc14, Func> taskFunc15, CancellationToken cancellationToken) 1852 | { 1853 | var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); 1854 | (int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14, T15 result15) result = default; 1855 | 1856 | try 1857 | { 1858 | result = await WhenAny( 1859 | taskFunc1(cts.Token), 1860 | taskFunc2(cts.Token), 1861 | taskFunc3(cts.Token), 1862 | taskFunc4(cts.Token), 1863 | taskFunc5(cts.Token), 1864 | taskFunc6(cts.Token), 1865 | taskFunc7(cts.Token), 1866 | taskFunc8(cts.Token), 1867 | taskFunc9(cts.Token), 1868 | taskFunc10(cts.Token), 1869 | taskFunc11(cts.Token), 1870 | taskFunc12(cts.Token), 1871 | taskFunc13(cts.Token), 1872 | taskFunc14(cts.Token), 1873 | taskFunc15(cts.Token) 1874 | ); 1875 | 1876 | cts.Cancel(); 1877 | } 1878 | catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token) 1879 | { 1880 | if (cancellationToken.IsCancellationRequested) 1881 | { 1882 | throw new OperationCanceledException(ex.Message, ex, cancellationToken); 1883 | } 1884 | 1885 | throw; 1886 | } 1887 | finally 1888 | { 1889 | cts.Dispose(); 1890 | } 1891 | 1892 | return result; 1893 | } 1894 | } 1895 | } 1896 | #endif 1897 | --------------------------------------------------------------------------------