mirror of https://github.com/Cysharp/UniTask
Compare commits
6 Commits
c615850ecd
...
cb57433ed8
Author | SHA1 | Date |
---|---|---|
|
cb57433ed8 | |
|
06067cd4c8 | |
|
d9983cfe27 | |
|
70eb7cd3ee | |
|
b02876e1df | |
|
17bbb168b4 |
|
@ -5,3 +5,8 @@ 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
|
||||||
|
ignore:
|
||||||
|
# I just want update action when major/minor version is updated. patch updates are too noisy.
|
||||||
|
- dependency-name: '*'
|
||||||
|
update-types:
|
||||||
|
- version-update:semver-patch
|
||||||
|
|
|
@ -13,7 +13,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: Cysharp/Actions/.github/actions/checkout@main
|
||||||
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
|
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
|
||||||
- run: dotnet build -c Debug
|
- run: dotnet build -c Debug
|
||||||
- run: dotnet test -c Debug
|
- run: dotnet test -c Debug
|
||||||
|
@ -30,7 +30,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Load secrets
|
- name: Load secrets
|
||||||
id: op-load-secret
|
id: op-load-secret
|
||||||
uses: 1password/load-secrets-action@v2
|
uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0 # v2.0.0
|
||||||
with:
|
with:
|
||||||
export-env: false
|
export-env: false
|
||||||
env:
|
env:
|
||||||
|
@ -39,7 +39,7 @@ jobs:
|
||||||
UNITY_PASSWORD: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/credential"
|
UNITY_PASSWORD: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/credential"
|
||||||
UNITY_SERIAL: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/serial"
|
UNITY_SERIAL: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/serial"
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: Cysharp/Actions/.github/actions/checkout@main
|
||||||
|
|
||||||
# Execute scripts: Export Package
|
# Execute scripts: Export Package
|
||||||
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
|
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
|
||||||
|
|
|
@ -11,21 +11,21 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: Cysharp/Actions/.github/actions/checkout@main
|
||||||
- uses: actions/checkout@v4
|
- uses: Cysharp/Actions/.github/actions/checkout@main
|
||||||
with:
|
with:
|
||||||
repository: Cysharp/DocfxTemplate
|
repository: Cysharp/DocfxTemplate
|
||||||
path: docs/_DocfxTemplate
|
path: docs/_DocfxTemplate
|
||||||
- uses: Kirbyrawr/docfx-action@master
|
- uses: Kirbyrawr/docfx-action@db9a22c8fe1e8693a2a21be54cb0b87dfaa72cc4
|
||||||
name: Docfx metadata
|
name: Docfx metadata
|
||||||
with:
|
with:
|
||||||
args: metadata docs/docfx.json
|
args: metadata docs/docfx.json
|
||||||
- uses: Kirbyrawr/docfx-action@master
|
- uses: Kirbyrawr/docfx-action@db9a22c8fe1e8693a2a21be54cb0b87dfaa72cc4
|
||||||
name: Docfx build
|
name: Docfx build
|
||||||
with:
|
with:
|
||||||
args: build docs/docfx.json
|
args: build docs/docfx.json
|
||||||
- name: Publish to GitHub Pages
|
- name: Publish to GitHub Pages
|
||||||
uses: peaceiris/actions-gh-pages@v4
|
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: docs/_site
|
publish_dir: docs/_site
|
||||||
|
|
|
@ -26,7 +26,7 @@ jobs:
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- run: echo ${{ needs.update-packagejson.outputs.sha }}
|
- run: echo ${{ needs.update-packagejson.outputs.sha }}
|
||||||
- uses: actions/checkout@v4
|
- uses: Cysharp/Actions/.github/actions/checkout@main
|
||||||
with:
|
with:
|
||||||
ref: ${{ needs.update-packagejson.outputs.sha }}
|
ref: ${{ needs.update-packagejson.outputs.sha }}
|
||||||
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
|
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
|
||||||
|
@ -51,7 +51,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Load secrets
|
- name: Load secrets
|
||||||
id: op-load-secret
|
id: op-load-secret
|
||||||
uses: 1password/load-secrets-action@v2
|
uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0 # v2.0.0
|
||||||
with:
|
with:
|
||||||
export-env: false
|
export-env: false
|
||||||
env:
|
env:
|
||||||
|
@ -61,7 +61,7 @@ jobs:
|
||||||
UNITY_SERIAL: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/serial"
|
UNITY_SERIAL: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/serial"
|
||||||
|
|
||||||
- run: echo ${{ needs.update-packagejson.outputs.sha }}
|
- run: echo ${{ needs.update-packagejson.outputs.sha }}
|
||||||
- uses: actions/checkout@v4
|
- uses: Cysharp/Actions/.github/actions/checkout@main
|
||||||
with:
|
with:
|
||||||
ref: ${{ needs.update-packagejson.outputs.sha }}
|
ref: ${{ needs.update-packagejson.outputs.sha }}
|
||||||
# Execute scripts: Export Package
|
# Execute scripts: Export Package
|
||||||
|
|
|
@ -8,8 +8,7 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
generateTOC:
|
generateTOC:
|
||||||
name: TOC Generator
|
name: TOC Generator
|
||||||
runs-on: ubuntu-latest
|
uses: Cysharp/Actions/.github/workflows/toc-generator.yaml@main
|
||||||
steps:
|
with:
|
||||||
- uses: technote-space/toc-generator@v4.3.1
|
TOC_TITLE: "## Table of Contents"
|
||||||
with:
|
secrets: inherit
|
||||||
TOC_TITLE: "## Table of Contents"
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ UniTask
|
||||||
|
|
||||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
## 目录
|
## Table of Contents
|
||||||
|
|
||||||
- [入门](#%E5%85%A5%E9%97%A8)
|
- [入门](#%E5%85%A5%E9%97%A8)
|
||||||
- [UniTask 和 AsyncOperation 的基础知识](#unitask-%E5%92%8C-asyncoperation-%E7%9A%84%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86)
|
- [UniTask 和 AsyncOperation 的基础知识](#unitask-%E5%92%8C-asyncoperation-%E7%9A%84%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86)
|
||||||
|
@ -43,7 +43,7 @@ UniTask
|
||||||
- [UniTaskSynchronizationContext](#unitasksynchronizationcontext)
|
- [UniTaskSynchronizationContext](#unitasksynchronizationcontext)
|
||||||
- [API 文档](#api-%E6%96%87%E6%A1%A3)
|
- [API 文档](#api-%E6%96%87%E6%A1%A3)
|
||||||
- [UPM 包](#upm-%E5%8C%85)
|
- [UPM 包](#upm-%E5%8C%85)
|
||||||
- [通过 git URL 安装](#%E9%80%9A%E8%BF%87-git-url-%E5%AE%89%E8%A3%85)
|
- [通过 git URL 安装](#%E9%80%9A%E8%BF%87-git-url-%E5%AE%89%E8%A3%85)
|
||||||
- [关于 .NET Core](#%E5%85%B3%E4%BA%8E-net-core)
|
- [关于 .NET Core](#%E5%85%B3%E4%BA%8E-net-core)
|
||||||
- [许可证](#%E8%AE%B8%E5%8F%AF%E8%AF%81)
|
- [许可证](#%E8%AE%B8%E5%8F%AF%E8%AF%81)
|
||||||
|
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue