From 5bfccaa3b6ea290f30cb44d854abdbe010e2b787 Mon Sep 17 00:00:00 2001 From: neuecc Date: Thu, 25 Jan 2024 21:51:40 +0900 Subject: [PATCH] autoReleaseWhenCancelled -> autoReleaseWhenCanceled --- .../AddressablesAsyncExtensions.cs | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs index 656e833d..620cfadc 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs @@ -21,12 +21,12 @@ public static UniTask.Awaiter GetAwaiter(this AsyncOperationHandle handle) return ToUniTask(handle).GetAwaiter(); } - public static UniTask WithCancellation(this AsyncOperationHandle handle, CancellationToken cancellationToken, bool cancelImmediately = false, bool autoReleaseWhenCancelled = false) + public static UniTask WithCancellation(this AsyncOperationHandle handle, CancellationToken cancellationToken, bool cancelImmediately = false, bool autoReleaseWhenCanceled = false) { - return ToUniTask(handle, cancellationToken: cancellationToken, cancelImmediately: cancelImmediately, autoReleaseWhenCancelled: autoReleaseWhenCancelled); + return ToUniTask(handle, cancellationToken: cancellationToken, cancelImmediately: cancelImmediately, autoReleaseWhenCanceled: autoReleaseWhenCanceled); } - public static UniTask ToUniTask(this AsyncOperationHandle handle, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false, bool autoReleaseWhenCancelled = false) + public static UniTask ToUniTask(this AsyncOperationHandle handle, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false, bool autoReleaseWhenCanceled = false) { if (cancellationToken.IsCancellationRequested) return UniTask.FromCanceled(cancellationToken); @@ -45,7 +45,7 @@ public static UniTask WithCancellation(this AsyncOperationHandle handle, Cancell return UniTask.CompletedTask; } - return new UniTask(AsyncOperationHandleConfiguredSource.Create(handle, timing, progress, cancellationToken, cancelImmediately, autoReleaseWhenCancelled, out var token), token); + return new UniTask(AsyncOperationHandleConfiguredSource.Create(handle, timing, progress, cancellationToken, cancelImmediately, autoReleaseWhenCanceled, out var token), token); } public struct AsyncOperationHandleAwaiter : ICriticalNotifyCompletion @@ -109,7 +109,7 @@ static AsyncOperationHandleConfiguredSource() CancellationToken cancellationToken; CancellationTokenRegistration cancellationTokenRegistration; IProgress progress; - bool autoReleaseWhenCancelled; + bool autoReleaseWhenCanceled; bool completed; UniTaskCompletionSourceCore core; @@ -119,7 +119,7 @@ static AsyncOperationHandleConfiguredSource() completedCallback = HandleCompleted; } - public static IUniTaskSource Create(AsyncOperationHandle handle, PlayerLoopTiming timing, IProgress progress, CancellationToken cancellationToken, bool cancelImmediately, bool autoReleaseWhenCancelled, out short token) + public static IUniTaskSource Create(AsyncOperationHandle handle, PlayerLoopTiming timing, IProgress progress, CancellationToken cancellationToken, bool cancelImmediately, bool autoReleaseWhenCanceled, out short token) { if (cancellationToken.IsCancellationRequested) { @@ -135,14 +135,14 @@ public static IUniTaskSource Create(AsyncOperationHandle handle, PlayerLoopTimin result.progress = progress; result.cancellationToken = cancellationToken; result.completed = false; - result.autoReleaseWhenCancelled = autoReleaseWhenCancelled; + result.autoReleaseWhenCanceled = autoReleaseWhenCanceled; if (cancelImmediately && cancellationToken.CanBeCanceled) { result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => { var promise = (AsyncOperationHandleConfiguredSource)state; - if (promise.autoReleaseWhenCancelled && promise.handle.IsValid()) + if (promise.autoReleaseWhenCanceled && promise.handle.IsValid()) { Addressables.Release(promise.handle); } @@ -176,7 +176,7 @@ void HandleCompleted(AsyncOperationHandle _) completed = true; if (cancellationToken.IsCancellationRequested) { - if (autoReleaseWhenCancelled && handle.IsValid()) + if (autoReleaseWhenCanceled && handle.IsValid()) { Addressables.Release(handle); } @@ -224,7 +224,7 @@ public bool MoveNext() if (cancellationToken.IsCancellationRequested) { completed = true; - if (autoReleaseWhenCancelled && handle.IsValid()) + if (autoReleaseWhenCanceled && handle.IsValid()) { Addressables.Release(handle); } @@ -261,12 +261,12 @@ public static UniTask.Awaiter GetAwaiter(this AsyncOperationHandle hand return ToUniTask(handle).GetAwaiter(); } - public static UniTask WithCancellation(this AsyncOperationHandle handle, CancellationToken cancellationToken, bool cancelImmediately = false, bool autoReleaseWhenCancelled = false) + public static UniTask WithCancellation(this AsyncOperationHandle handle, CancellationToken cancellationToken, bool cancelImmediately = false, bool autoReleaseWhenCanceled = false) { - return ToUniTask(handle, cancellationToken: cancellationToken, cancelImmediately: cancelImmediately, autoReleaseWhenCancelled: autoReleaseWhenCancelled); + return ToUniTask(handle, cancellationToken: cancellationToken, cancelImmediately: cancelImmediately, autoReleaseWhenCanceled: autoReleaseWhenCanceled); } - public static UniTask ToUniTask(this AsyncOperationHandle handle, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false, bool autoReleaseWhenCancelled = false) + public static UniTask ToUniTask(this AsyncOperationHandle handle, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false, bool autoReleaseWhenCanceled = false) { if (cancellationToken.IsCancellationRequested) return UniTask.FromCanceled(cancellationToken); @@ -284,7 +284,7 @@ public static UniTask WithCancellation(this AsyncOperationHandle handle return UniTask.FromResult(handle.Result); } - return new UniTask(AsyncOperationHandleConfiguredSource.Create(handle, timing, progress, cancellationToken, cancelImmediately, autoReleaseWhenCancelled, out var token), token); + return new UniTask(AsyncOperationHandleConfiguredSource.Create(handle, timing, progress, cancellationToken, cancelImmediately, autoReleaseWhenCanceled, out var token), token); } sealed class AsyncOperationHandleConfiguredSource : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode> @@ -303,7 +303,7 @@ static AsyncOperationHandleConfiguredSource() CancellationToken cancellationToken; CancellationTokenRegistration cancellationTokenRegistration; IProgress progress; - bool autoReleaseWhenCancelled; + bool autoReleaseWhenCanceled; bool completed; UniTaskCompletionSourceCore core; @@ -313,7 +313,7 @@ static AsyncOperationHandleConfiguredSource() completedCallback = HandleCompleted; } - public static IUniTaskSource Create(AsyncOperationHandle handle, PlayerLoopTiming timing, IProgress progress, CancellationToken cancellationToken, bool cancelImmediately, bool autoReleaseWhenCancelled, out short token) + public static IUniTaskSource Create(AsyncOperationHandle handle, PlayerLoopTiming timing, IProgress progress, CancellationToken cancellationToken, bool cancelImmediately, bool autoReleaseWhenCanceled, out short token) { if (cancellationToken.IsCancellationRequested) { @@ -329,14 +329,14 @@ public static IUniTaskSource Create(AsyncOperationHandle handle, PlayerLoo result.cancellationToken = cancellationToken; result.completed = false; result.progress = progress; - result.autoReleaseWhenCancelled = autoReleaseWhenCancelled; + result.autoReleaseWhenCanceled = autoReleaseWhenCanceled; if (cancelImmediately && cancellationToken.CanBeCanceled) { result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => { var promise = (AsyncOperationHandleConfiguredSource)state; - if (promise.autoReleaseWhenCancelled && promise.handle.IsValid()) + if (promise.autoReleaseWhenCanceled && promise.handle.IsValid()) { Addressables.Release(promise.handle); } @@ -370,7 +370,7 @@ void HandleCompleted(AsyncOperationHandle argHandle) completed = true; if (cancellationToken.IsCancellationRequested) { - if (autoReleaseWhenCancelled && handle.IsValid()) + if (autoReleaseWhenCanceled && handle.IsValid()) { Addressables.Release(handle); } @@ -423,7 +423,7 @@ public bool MoveNext() if (cancellationToken.IsCancellationRequested) { completed = true; - if (autoReleaseWhenCancelled && handle.IsValid()) + if (autoReleaseWhenCanceled && handle.IsValid()) { Addressables.Release(handle); }