mirror of
https://github.com/Cysharp/UniTask.git
synced 2026-05-26 10:00:23 +00:00
Compare commits
4 Commits
ee89b9a5a5
...
f62b216d8c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f62b216d8c | ||
|
|
73a63b7f67 | ||
|
|
30bec5d5c4 | ||
|
|
2c20cf1e5d |
1
.github/workflows/build-release.yaml
vendored
1
.github/workflows/build-release.yaml
vendored
@@ -101,6 +101,7 @@ jobs:
|
||||
needs: [update-packagejson, build-dotnet, build-unity]
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write # required for NuGet Trusted Publish
|
||||
uses: Cysharp/Actions/.github/workflows/create-release.yaml@main
|
||||
with:
|
||||
commit-id: ${{ needs.update-packagejson.outputs.sha }}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#if UNITASK_TEXTMESHPRO_SUPPORT
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using TMPro;
|
||||
|
||||
namespace Cysharp.Threading.Tasks
|
||||
{
|
||||
public static partial class TextMeshProAsyncExtensions
|
||||
{
|
||||
public static IAsyncValueChangedEventHandler<int> GetAsyncValueChangedEventHandler(this TMP_Dropdown dropdown)
|
||||
{
|
||||
return new AsyncUnityEventHandler<int>(dropdown.onValueChanged, dropdown.GetCancellationTokenOnDestroy(), false);
|
||||
}
|
||||
|
||||
public static IAsyncValueChangedEventHandler<int> GetAsyncValueChangedEventHandler(this TMP_Dropdown dropdown, CancellationToken cancellationToken)
|
||||
{
|
||||
return new AsyncUnityEventHandler<int>(dropdown.onValueChanged, cancellationToken, false);
|
||||
}
|
||||
|
||||
public static UniTask<int> OnValueChangedAsync(this TMP_Dropdown dropdown)
|
||||
{
|
||||
return new AsyncUnityEventHandler<int>(dropdown.onValueChanged, dropdown.GetCancellationTokenOnDestroy(), true).OnInvokeAsync();
|
||||
}
|
||||
|
||||
public static UniTask<int> OnValueChangedAsync(this TMP_Dropdown dropdown, CancellationToken cancellationToken)
|
||||
{
|
||||
return new AsyncUnityEventHandler<int>(dropdown.onValueChanged, cancellationToken, true).OnInvokeAsync();
|
||||
}
|
||||
|
||||
public static IUniTaskAsyncEnumerable<int> OnValueChangedAsAsyncEnumerable(this TMP_Dropdown dropdown)
|
||||
{
|
||||
return new UnityEventHandlerAsyncEnumerable<int>(dropdown.onValueChanged, dropdown.GetCancellationTokenOnDestroy());
|
||||
}
|
||||
|
||||
public static IUniTaskAsyncEnumerable<int> OnValueChangedAsAsyncEnumerable(this TMP_Dropdown dropdown, CancellationToken cancellationToken)
|
||||
{
|
||||
return new UnityEventHandlerAsyncEnumerable<int>(dropdown.onValueChanged, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b858132b120c42b99cac55fd06dd32d3
|
||||
timeCreated: 1736165018
|
||||
Reference in New Issue
Block a user