From 15a605b6774c66aba9d41cda59976217941fe66f Mon Sep 17 00:00:00 2001 From: hevinci Date: Tue, 13 Dec 2022 12:22:27 +0800 Subject: [PATCH] update UniTask sample --- .../YooAsset/OperationHandleBaseExtensions.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs b/Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs index ea4d57b..06e5b07 100644 --- a/Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs +++ b/Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs @@ -98,9 +98,12 @@ namespace Cysharp.Threading.Tasks case SubAssetsOperationHandle sub_asset_handle: sub_asset_handle.Completed += result.SubContinuation; break; + case RawFileOperationHandle raw_file_handle: + raw_file_handle.Completed += result.RawFileContinuation; + break; } #else - switch(handle) + switch (handle) { case AssetOperationHandle asset_handle: asset_handle.Completed += result.continuationAction; @@ -111,6 +114,9 @@ namespace Cysharp.Threading.Tasks case SubAssetsOperationHandle sub_asset_handle: sub_asset_handle.Completed += result.continuationAction; break; + case RawFileOperationHandle raw_file_handle: + raw_file_handle.Completed += result.continuationAction; + break; } #endif token = result.core.Version; @@ -135,6 +141,12 @@ namespace Cysharp.Threading.Tasks handle.Completed -= SubContinuation; BaseContinuation(); } + + private void RawFileContinuation(RawFileOperationHandle handle) + { + handle.Completed -= RawFileContinuation; + BaseContinuation(); + } #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] private void BaseContinuation() @@ -170,6 +182,9 @@ namespace Cysharp.Threading.Tasks case SubAssetsOperationHandle sub_asset_handle: sub_asset_handle.Completed -= continuationAction; break; + case RawFileOperationHandle raw_file_handle: + raw_file_handle.Completed -= continuationAction; + break; } BaseContinuation();