Compare commits

..

6 Commits

Author SHA1 Message Date
github-actions[bot]
2e993ff18f chore(automate): Update package.json to 2.5.11
Commit by [GitHub Actions](https://github.com/Cysharp/UniTask/actions/runs/26083685280)
2026-05-19 07:47:19 +00:00
Yoshifumi Kawai
f248391774 Merge pull request #706 from chikacc/master
fix: resolve TreeView deprecation in Unity 6.2+
2026-05-19 16:46:26 +09:00
Chika Chang
0d304f1feb fix: resolve TreeView deprecation in Unity 6.2+ 2026-03-28 15:36:49 +08:00
Ikiru Yoshizaki
a9e27c03d4 chore: add groups for dependabot 2026-02-25 18:03:24 +09:00
Ikiru Yoshizaki
73a63b7f67 Merge pull request #680 from Cysharp/ci/nuget_release
ci: add id-token: write for NuGet Trusted Publish
2025-10-01 16:31:33 +09:00
Ikiru Yoshizaki
30bec5d5c4 ci: add id-token: write for NuGet Trusted Publish 2025-10-01 16:03:54 +09:00
10 changed files with 28 additions and 19 deletions

View File

@@ -5,6 +5,10 @@ updates:
directory: "/" directory: "/"
schedule: schedule:
interval: "weekly" # Check for updates to GitHub Actions every week interval: "weekly" # Check for updates to GitHub Actions every week
groups:
dependencies:
patterns:
- "*"
cooldown: cooldown:
default-days: 14 # Wait 14 days before creating another PR for the same dependency. This will prevent vulnerability on the package impact. default-days: 14 # Wait 14 days before creating another PR for the same dependency. This will prevent vulnerability on the package impact.
ignore: ignore:

View File

@@ -101,6 +101,7 @@ jobs:
needs: [update-packagejson, build-dotnet, build-unity] needs: [update-packagejson, build-dotnet, build-unity]
permissions: permissions:
contents: write contents: write
id-token: write # required for NuGet Trusted Publish
uses: Cysharp/Actions/.github/workflows/create-release.yaml@main uses: Cysharp/Actions/.github/workflows/create-release.yaml@main
with: with:
commit-id: ${{ needs.update-packagejson.outputs.sha }} commit-id: ${{ needs.update-packagejson.outputs.sha }}

View File

@@ -10,6 +10,11 @@ using UnityEditor.IMGUI.Controls;
using Cysharp.Threading.Tasks.Internal; using Cysharp.Threading.Tasks.Internal;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
#if UNITY_6000_2_OR_NEWER
using TreeView = UnityEditor.IMGUI.Controls.TreeView<int>;
using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem<int>;
using TreeViewState = UnityEditor.IMGUI.Controls.TreeViewState<int>;
#endif
namespace Cysharp.Threading.Tasks.Editor namespace Cysharp.Threading.Tasks.Editor
{ {
@@ -179,4 +184,3 @@ namespace Cysharp.Threading.Tasks.Editor
} }
} }

View File

@@ -67,13 +67,13 @@ namespace Cysharp.Threading.Tasks
return (UniTask.FromCanceled(cancellationToken), default(CancellationTokenRegistration)); return (UniTask.FromCanceled(cancellationToken), default(CancellationTokenRegistration));
} }
var promise = AutoResetUniTaskCompletionSource.Create(); var promise = new UniTaskCompletionSource();
return (promise.Task, cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationTokenCallback, promise)); return (promise.Task, cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationTokenCallback, promise));
} }
static void Callback(object state) static void Callback(object state)
{ {
var promise = (AutoResetUniTaskCompletionSource)state; var promise = (UniTaskCompletionSource)state;
promise.TrySetResult(); promise.TrySetResult();
} }

View File

@@ -91,7 +91,7 @@ namespace Cysharp.Threading.Tasks
{ {
readonly Queue<T> items; readonly Queue<T> items;
readonly SingleConsumerUnboundedChannelReader readerSource; readonly SingleConsumerUnboundedChannelReader readerSource;
AutoResetUniTaskCompletionSource completedTaskSource; UniTaskCompletionSource completedTaskSource;
UniTask completedTask; UniTask completedTask;
Exception completionError; Exception completionError;
@@ -208,7 +208,7 @@ namespace Cysharp.Threading.Tasks
return parent.completedTask; return parent.completedTask;
} }
parent.completedTaskSource = AutoResetUniTaskCompletionSource.Create(); parent.completedTaskSource = new UniTaskCompletionSource();
return parent.completedTaskSource.Task; return parent.completedTaskSource.Task;
} }
} }

View File

@@ -36,11 +36,11 @@ namespace Cysharp.Threading.Tasks.Linq
public UniTask<bool> MoveNextAsync() public UniTask<bool> MoveNextAsync()
{ {
var tcs = AutoResetUniTaskCompletionSource<bool>.Create(); var tcs = new UniTaskCompletionSource<bool>();
cancellationToken.Register(state => cancellationToken.Register(state =>
{ {
var task = (AutoResetUniTaskCompletionSource<bool>)state; var task = (UniTaskCompletionSource<bool>)state;
task.TrySetCanceled(cancellationToken); task.TrySetCanceled(cancellationToken);
}, tcs); }, tcs);

View File

@@ -18,13 +18,13 @@ namespace Cysharp.Threading.Tasks
#endif #endif
/// <summary>This CancellationToken is canceled when the GameObject will be destroyed.</summary> /// <summary>This CancellationToken is canceled when the MonoBehaviour will be destroyed.</summary>
public static CancellationToken GetCancellationTokenOnDestroy(this GameObject gameObject) public static CancellationToken GetCancellationTokenOnDestroy(this GameObject gameObject)
{ {
return gameObject.GetAsyncDestroyTrigger().CancellationToken; return gameObject.GetAsyncDestroyTrigger().CancellationToken;
} }
/// <summary>This CancellationToken is canceled when the Component will be destroyed.</summary> /// <summary>This CancellationToken is canceled when the MonoBehaviour will be destroyed.</summary>
public static CancellationToken GetCancellationTokenOnDestroy(this Component component) public static CancellationToken GetCancellationTokenOnDestroy(this Component component)
{ {
#if UNITY_2022_2_OR_NEWER #if UNITY_2022_2_OR_NEWER

View File

@@ -16,11 +16,11 @@ namespace Cysharp.Threading.Tasks
/// </summary> /// </summary>
public static UniTask<T> AsUniTask<T>(this Task<T> task, bool useCurrentSynchronizationContext = true) public static UniTask<T> AsUniTask<T>(this Task<T> task, bool useCurrentSynchronizationContext = true)
{ {
var promise = AutoResetUniTaskCompletionSource<T>.Create(); var promise = new UniTaskCompletionSource<T>();
task.ContinueWith((x, state) => task.ContinueWith((x, state) =>
{ {
var p = (AutoResetUniTaskCompletionSource<T>)state; var p = (UniTaskCompletionSource<T>)state;
switch (x.Status) switch (x.Status)
{ {
@@ -46,11 +46,11 @@ namespace Cysharp.Threading.Tasks
/// </summary> /// </summary>
public static UniTask AsUniTask(this Task task, bool useCurrentSynchronizationContext = true) public static UniTask AsUniTask(this Task task, bool useCurrentSynchronizationContext = true)
{ {
var promise = AutoResetUniTaskCompletionSource.Create(); var promise = new UniTaskCompletionSource();
task.ContinueWith((x, state) => task.ContinueWith((x, state) =>
{ {
var p = (AutoResetUniTaskCompletionSource)state; var p = (UniTaskCompletionSource)state;
switch (x.Status) switch (x.Status)
{ {

View File

@@ -11,7 +11,7 @@ namespace Cysharp.Threading.Tasks
{ {
public static UniTask<T> ToUniTask<T>(this IObservable<T> source, bool useFirstValue = false, CancellationToken cancellationToken = default) public static UniTask<T> ToUniTask<T>(this IObservable<T> source, bool useFirstValue = false, CancellationToken cancellationToken = default)
{ {
var promise = AutoResetUniTaskCompletionSource<T>.Create(); var promise = new UniTaskCompletionSource<T>();
var disposable = new SingleAssignmentDisposable(); var disposable = new SingleAssignmentDisposable();
var observer = useFirstValue var observer = useFirstValue
@@ -109,7 +109,7 @@ namespace Cysharp.Threading.Tasks
{ {
static readonly Action<object> callback = OnCanceled; static readonly Action<object> callback = OnCanceled;
readonly IPromise<T> promise; readonly UniTaskCompletionSource<T> promise;
readonly SingleAssignmentDisposable disposable; readonly SingleAssignmentDisposable disposable;
readonly CancellationToken cancellationToken; readonly CancellationToken cancellationToken;
readonly CancellationTokenRegistration registration; readonly CancellationTokenRegistration registration;
@@ -117,7 +117,7 @@ namespace Cysharp.Threading.Tasks
bool hasValue; bool hasValue;
T latestValue; T latestValue;
public ToUniTaskObserver(IPromise<T> promise, SingleAssignmentDisposable disposable, CancellationToken cancellationToken) public ToUniTaskObserver(UniTaskCompletionSource<T> promise, SingleAssignmentDisposable disposable, CancellationToken cancellationToken)
{ {
this.promise = promise; this.promise = promise;
this.disposable = disposable; this.disposable = disposable;
@@ -180,14 +180,14 @@ namespace Cysharp.Threading.Tasks
{ {
static readonly Action<object> callback = OnCanceled; static readonly Action<object> callback = OnCanceled;
readonly IPromise<T> promise; readonly UniTaskCompletionSource<T> promise;
readonly SingleAssignmentDisposable disposable; readonly SingleAssignmentDisposable disposable;
readonly CancellationToken cancellationToken; readonly CancellationToken cancellationToken;
readonly CancellationTokenRegistration registration; readonly CancellationTokenRegistration registration;
bool hasValue; bool hasValue;
public FirstValueToUniTaskObserver(IPromise<T> promise, SingleAssignmentDisposable disposable, CancellationToken cancellationToken) public FirstValueToUniTaskObserver(UniTaskCompletionSource<T> promise, SingleAssignmentDisposable disposable, CancellationToken cancellationToken)
{ {
this.promise = promise; this.promise = promise;
this.disposable = disposable; this.disposable = disposable;

View File

@@ -2,7 +2,7 @@
"name": "com.cysharp.unitask", "name": "com.cysharp.unitask",
"displayName": "UniTask", "displayName": "UniTask",
"author": { "name": "Cysharp, Inc.", "url": "https://cysharp.co.jp/en/" }, "author": { "name": "Cysharp, Inc.", "url": "https://cysharp.co.jp/en/" },
"version": "2.5.10", "version": "2.5.11",
"unity": "2018.4", "unity": "2018.4",
"description": "Provides an efficient async/await integration to Unity.", "description": "Provides an efficient async/await integration to Unity.",
"keywords": [ "async/await", "async", "Task", "UniTask" ], "keywords": [ "async/await", "async", "Task", "UniTask" ],