Compare commits

..

796 Commits

Author SHA1 Message Date
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
Ikiru Yoshizaki
ec9204d381 Merge pull request #679 from Cysharp/feature/nuget
chore: Specify IsPackable=false on Directory.Build.props, explicitly true for target packages.
2025-09-25 01:12:10 +09:00
Ikiru Yoshizaki
9a6584ff0d chore: Specify IsPackable=false on Directory.Build.props, explicitly true for target packages. 2025-09-24 21:17:25 +09:00
Ikiru Yoshizaki
98538ef7c7 Merge pull request #677 from Cysharp/feature/docs
ci: replace docfx build from container to docfx command
2025-09-13 01:23:03 +09:00
Ikiru Yoshizaki
519590ca6e chore: exclude tests assemblies 2025-09-10 18:38:31 +09:00
Ikiru Yoshizaki
dce4366f3e ci: change docfx target from source code to Unity built assemblies 2025-09-10 18:20:17 +09:00
Ikiru Yoshizaki
88026ab14a ci: replace docfx build from container to docfx command 2025-09-10 17:20:43 +09:00
Ikiru Yoshizaki
95998ff3f2 ci: dependabot cooldown 65d2ae 2025-09-10 12:34:40 +09:00
Ikiru Yoshizaki
64285ae060 Merge pull request #672 from Cysharp/ci/nuget_readme
chore: add README.md to nuget package
2025-08-19 18:37:19 +09:00
Ikiru Yoshizaki
40e020fb02 ci: add dotnet pack and use Release 2025-08-19 17:42:54 +09:00
Ikiru Yoshizaki
e63dba1350 chore: add README.md to nuget package 2025-08-19 17:37:09 +09:00
Ikiru Yoshizaki
f213ff497e ci: missing permission 2025-05-14 15:41:23 +09:00
Ikiru Yoshizaki
7568061eda ci: fix ghalint 2025-05-14 12:39:03 +09:00
Ikiru Yoshizaki
459a572c1d chore: add .editorconfig 2025-05-14 12:38:53 +09:00
Ikiru Yoshizaki
06067cd4c8 ci: use Cysharp/Actions checkout instead of 3rd party directly 2025-03-19 15:44:16 +09:00
Ikiru Yoshizaki
d9983cfe27 Merge pull request #654 from Cysharp/feature/pin_action
ci: Pinning third party GitHub Actions sha
2025-03-18 17:33:39 +09:00
Ikiru Yoshizaki
70eb7cd3ee ci: Pinning third party GitHub Actions sha 2025-03-18 16:58:33 +09:00
Ikiru Yoshizaki
cc3c70af90 ci: update vault 2025-03-11 12:55:51 +09:00
Ikiru Yoshizaki
8042b29ff8 ci: extend timeout 2025-01-07 12:29:34 +09:00
Yoshifumi Kawai
b0d01ca75f Merge pull request #641 from hmkc/dev
Update README_CN.md
2024-12-12 16:35:32 +09:00
hmkc
7a63ab7088 Update README_CN.md
Re-translated the documentation.
2024-12-11 17:13:32 +08:00
Yoshifumi Kawai
bdf102f145 Merge pull request #639 from hmkc/dev
Update README_CN.md
2024-12-09 20:18:43 +09:00
hmkc
41cea030ab Update README_CN.md 2024-12-09 18:39:08 +08:00
Yoshifumi Kawai
f9fd769be7 Update README.md 2024-10-09 14:46:23 +09:00
neuecc
579304fe47 chore(docs): update TOC 2024-10-08 14:02:41 +00:00
Yoshifumi Kawai
740ca7ef01 Awaitable notes 2024-10-08 23:02:26 +09:00
github-actions[bot]
7c0f199fe0 feat: Update package.json to 2.5.10 2024-10-03 00:42:37 +00:00
neuecc
9a3ec31533 Merge remote-tracking branch 'origin/master' 2024-10-03 09:41:47 +09:00
neuecc
37d8f4f48e C# 8 #624 2024-10-03 09:41:30 +09:00
github-actions[bot]
27a0c06ede feat: Update package.json to 2.5.9 2024-10-01 06:16:52 +00:00
neuecc
e4082ecd75 Merge remote-tracking branch 'origin/master' 2024-10-01 14:59:02 +09:00
neuecc
3b0fd784ff meta 2024-10-01 14:58:57 +09:00
neuecc
dc9ebfd765 Add AsyncInstantiateOperation.WithCancellation, ToUniTask for Unity 2022.3.20/Unity 2022.3 or newer 2024-10-01 14:50:13 +09:00
Yoshifumi Kawai
005c83fbd7 Merge pull request #623 from Cysharp/feature/ci
ci: remove Unity 2021 LTS from Build matrix
2024-10-01 10:44:30 +09:00
github-actions[bot]
5984b67ecb feat: Update package.json to 2.5.8 2024-09-30 11:45:57 +00:00
neuecc
05fdf48058 Merge remote-tracking branch 'origin/master' 2024-09-30 20:43:06 +09:00
Yoshifumi Kawai
647ed6ff82 Merge pull request #621 from dvsilch/master
add generic type UnityAction support & fix typo
2024-09-30 20:42:57 +09:00
neuecc
0826b7e976 Add UniTask.WhenEach 2024-09-30 20:42:17 +09:00
dvsilch
a51632cd4b fix: add overloads for CancellationToken 2024-09-30 10:13:29 +08:00
dvsilch
bf945a7ef4 fix: rename parameters and type parameters 2024-09-30 10:11:36 +08:00
dvsilch
353f15e94f fix: add .Forget() call and rename paramters to keep coding style consistent 2024-09-27 23:45:05 +08:00
dvsilch
cf19f18662 fix: typo 2024-09-27 22:57:36 +08:00
dvsilch
fdb9d1cf95 feature: add overload in UniTask.UnityAction to support generic type UnityAction 2024-09-27 22:57:05 +08:00
Yoshifumi Kawai
2e0917428b Merge pull request #620 from albermotion/master
Added a note for users using Unity 2023.1 or newer to prevent compilation error
2024-09-27 09:48:04 +09:00
Alberto
0b16005f4b Added a note for users using Unity 2023.1 or newer 2024-09-26 22:33:37 +02:00
github-actions[bot]
74bbe87b58 feat: Update package.json to 2.5.7 2024-09-26 06:24:48 +00:00
Yoshifumi Kawai
6f4131539b Merge pull request #619 from kochounoyume/add-state-argument
Add overload in UniTask.WaitUntil, UniTask.WaitWhile and UniTask.Defer
2024-09-26 12:52:56 +09:00
Kochoyume
06283f0ffb Add to the code that I forgot to write 2024-09-24 23:58:28 +09:00
Kochoyume
dfe5ee43c2 Add overload in UniTask.WaitUntil, UniTask.WaitWhile and UniTask.Defer to avoid closure allocation 2024-09-24 23:37:44 +09:00
Ikiru Yoshizaki
eaa553dc83 ci: remove Unity 2021 LTS from Build matrix 2024-09-24 18:30:54 +09:00
github-actions[bot]
83d8a2b424 feat: Update package.json to 2.5.6 2024-09-24 09:20:07 +00:00
Yoshifumi Kawai
4d204e4aa6 Update build-debug.yml 2024-09-24 17:49:34 +09:00
Yoshifumi Kawai
87e164e275 Merge pull request #600 from Iblis/textmeshpro_unity6_adoptions
TextMeshPro Unity6 adoptions
2024-09-24 17:16:20 +09:00
Yoshifumi Kawai
b63eb8d090 Merge pull request #610 from LucianoPC/forget-ignored-task
Forget ignored task
2024-09-24 17:14:40 +09:00
neuecc
75119acb50 Fix WaitWhile(bool cancelImmediately = true) does not work correctly
, and when cancelImmediately = true and canceled task remove Trakcking immediately
2024-09-24 17:12:50 +09:00
Ikiru Yoshizaki
f7b3c2fbe1 ci: update release unity version to 2022.3.39f1 [skip ci] 2024-09-18 17:06:00 +09:00
Ikiru Yoshizaki
b317ecfa01 ci: set max-parallel to restrict up to 2 run [skip ci] 2024-09-18 16:27:42 +09:00
Ikiru Yoshizaki
7b05569ef7 ci: single job 2024-09-18 16:27:42 +09:00
Luciano Prestes Cavalcanti
e0465c6c2c Forget ignored task 2024-08-19 08:18:57 -03:00
Yoshifumi Kawai
9057452c86 Merge pull request #607 from Redpenguine/master
fix: incorrect download progress reporting
2024-08-14 19:54:15 +09:00
Mykyta Myronenko
a2f6f84bde fix: incorrect download progress reporting 2024-08-10 19:29:54 +03:00
Ikiru Yoshizaki
f057abff0f chore: remove Unity UserSettigs from git handling 2024-07-31 16:11:03 +09:00
Ikiru Yoshizaki
c61a7d9961 Merge pull request #605 from Cysharp/dependabot/github_actions/peaceiris/actions-gh-pages-4
chore(deps): bump peaceiris/actions-gh-pages from 3 to 4
2024-07-30 17:09:56 +09:00
Ikiru Yoshizaki
9587f2eeec Merge pull request #606 from Cysharp/dependabot/github_actions/technote-space/toc-generator-4.3.1
chore(deps): bump technote-space/toc-generator from 2.4.0 to 4.3.1
2024-07-30 17:09:49 +09:00
Ikiru Yoshizaki
550784f31c ci: check not dependabot 2024-07-30 17:07:43 +09:00
Ikiru Yoshizaki
11b3282b3d ci: Don't allow dependabot to run Unity CI 2024-07-30 17:01:09 +09:00
dependabot[bot]
b2532b0798 chore(deps): bump technote-space/toc-generator from 2.4.0 to 4.3.1
Bumps [technote-space/toc-generator](https://github.com/technote-space/toc-generator) from 2.4.0 to 4.3.1.
- [Release notes](https://github.com/technote-space/toc-generator/releases)
- [Changelog](https://github.com/technote-space/toc-generator/blob/main/.releasegarc)
- [Commits](https://github.com/technote-space/toc-generator/compare/v2.4.0...v4.3.1)

---
updated-dependencies:
- dependency-name: technote-space/toc-generator
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-30 06:42:27 +00:00
dependabot[bot]
4fc41ecb17 chore(deps): bump peaceiris/actions-gh-pages from 3 to 4
Bumps [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages) from 3 to 4.
- [Release notes](https://github.com/peaceiris/actions-gh-pages/releases)
- [Changelog](https://github.com/peaceiris/actions-gh-pages/blob/main/CHANGELOG.md)
- [Commits](https://github.com/peaceiris/actions-gh-pages/compare/v3...v4)

---
updated-dependencies:
- dependency-name: peaceiris/actions-gh-pages
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-30 06:42:24 +00:00
Ikiru Yoshizaki
e52663cef6 Merge pull request #570 from Cysharp/ci/dependabot
ci: add depndabot.yaml to update github-actions
2024-07-30 15:41:57 +09:00
Ikiru Yoshizaki
1827be2de7 Merge pull request #603 from Cysharp/feature/test
ci: Change Unity UnitTest from Mono to IL2CPP and enabled on CI
2024-07-30 15:41:47 +09:00
Ikiru Yoshizaki
8560561ef3 chore: remove Layouts for Unity2022 2024-07-30 15:17:05 +09:00
Ikiru Yoshizaki
2019f1fa7f ci: update CI Unity 2024-07-30 15:16:54 +09:00
Ikiru Yoshizaki
9e2265d148 ci: split job for build and test 2024-07-30 14:46:59 +09:00
Ikiru Yoshizaki
9d02279822 ci: extend Unity Build timeout to 20m 2024-07-30 14:25:31 +09:00
Ikiru Yoshizaki
17ce06d93c chore: remove com.unity.ai.navigation as 2021.3.39f1 failed and not inuse 2024-07-30 14:07:59 +09:00
Ikiru Yoshizaki
7b810413fe fix: missing include Packages folder for Unity 2024-07-30 14:00:06 +09:00
Ikiru Yoshizaki
d78c0d6c02 ci: remove garbage folder 2024-07-30 12:36:34 +09:00
Ikiru Yoshizaki
d248acc7d1 chore: bump RuntimeUnitTestToolkit to 2.6.0 to adapt Unity 2022 Build API change 2024-07-30 12:34:46 +09:00
Ikiru Yoshizaki
4c0b1f753a chore: bump UniTask unity version to 2022.3.39f1 2024-07-24 20:11:26 +09:00
Ikiru Yoshizaki
7bb6feda55 chore: switch to src/UniTask/*.cproj 2024-07-24 20:10:17 +09:00
Ikiru Yoshizaki
f8a501290a chore: upload 2024-07-24 20:08:11 +09:00
Ikiru Yoshizaki
cb497c9eb5 ci: bump Unity version to LTS, Unity Unit Test with LTS. 2024-07-24 19:35:31 +09:00
Ikiru Yoshizaki
342a37a074 ci: add strategy.fail-fast: false 2024-07-24 17:44:49 +09:00
Ikiru Yoshizaki
c3146ec74f ci: change Unit Test to IL2CPP 2024-07-24 17:24:01 +09:00
Ikiru Yoshizaki
df16813fae ci: bump actions/checkout@v3 -> v4 2024-07-24 17:22:28 +09:00
Philipp Walser
8d98bbc7ba added version contraint, tmp is part of ugui since v2.0.0 2024-07-12 19:05:38 +02:00
Philipp Walser
bb095697f7 added versionDefine to set TMP support if ugui is found, too 2024-07-12 19:01:59 +02:00
github-actions[bot]
cdf88c6a6a feat: Update package.json to 2.5.5 2024-07-01 06:47:55 +00:00
Yoshifumi Kawai
4eee2c9270 Merge pull request #599 from xfvvvv/patch-1
Fix onTextSelection and onEndTextSelection stack overflow issue
2024-07-01 15:45:30 +09:00
Chelal
222b1401f5 Fix onTextSelection and onEndTextSelection stack overflow issue 2024-06-29 21:51:27 +08:00
Ikiru Yoshizaki
fbe0bf8515 Merge pull request #579 from Cysharp/feature/artifact
ci: change upload-artifact & download-artifact to Cysharp/Actions
2024-04-30 14:36:53 +09:00
Ikiru Yoshizaki
626685292c ci: set upload-artifact retention-period: 1 2024-04-30 14:06:49 +09:00
Ikiru Yoshizaki
67794f5cdd ci: change upload-artifact & download-artifact to Cysharp/Actions 2024-04-30 12:43:17 +09:00
Mayuki Sawatari
2e225fb841 Merge pull request #571 from Cysharp/feature/secret
feat: change load secret from op
2024-04-17 18:29:49 +09:00
Ikiru Yoshizaki
935523f25c feat: change load secret from op 2024-04-17 16:09:55 +09:00
Ikiru Yoshizaki
3b3f7ebd3e ci: add depndabot.yaml to update github-actions 2024-04-16 12:14:52 +09:00
Yoshifumi Kawai
88ecfa2992 Merge pull request #565 from divdeploy/master
chore: fix comment
2024-04-08 17:03:08 +09:00
divdeploy
aa70fe5c5a chore: fix comment
Signed-off-by: divdeploy <chenguangxue@outlook.com>
2024-04-05 23:28:56 +08:00
Yoshifumi Kawai
0c8057c668 Merge pull request #538 from kochounoyume/argument-allowed-factory
Factory method allowed argument
2024-04-05 13:30:39 +09:00
Kochoyume
28867646b0 Fix T state as the first argument 2024-03-31 00:05:18 +09:00
Kochoyume
ca60864021 Fix comment 2024-03-30 23:57:43 +09:00
Kochoyume
1e4561da22 Fix comment 2024-03-30 23:57:43 +09:00
Kochoyume
1496cc990a Fix misspelling 2024-03-30 23:57:43 +09:00
Kochoyume
7bb3bf8d0e Update UniTask.Create, Unitask.Action and UniTask.UnityAction 2024-03-30 23:57:43 +09:00
github-actions[bot]
d057074f17 feat: Update package.json to 2.5.4 2024-03-28 06:22:15 +00:00
hadashiA
b724a2aa84 Merge pull request #557 from Cysharp/hadashiA/fix-cancel-immediate
Fix unintended returning to pool with cancelImmediately
2024-03-28 15:21:40 +09:00
hadashiA
938ddd5356 Tweaks 2024-03-28 15:15:55 +09:00
hadashiA
911c37d4d8 Tweaks 2024-03-28 15:14:10 +09:00
hadashiA
caccccb0b5 Fix timing to returning to pool 2024-03-28 15:00:41 +09:00
hadashiA
a48f11d31b Fix unintended returning to pool with cancelImmediately (WaitUntil,etc) 2024-03-28 14:46:37 +09:00
hadashiA
fcd93feb56 Fix unintended returning to pool with cancelImmediately (AsyncOperation) 2024-03-28 14:45:55 +09:00
hadashiA
b472b23773 Fix unintended returning to pool with cancelImmediately (UniTask.Delay) 2024-03-28 14:29:30 +09:00
Yoshifumi Kawai
01c8fada1f Merge pull request #542 from Cysharp/feature/new_release
ci: Cysharp/Actions/.github/workflows/create-release.yaml
2024-03-25 18:30:50 +09:00
Ikiru Yoshizaki
10cd137126 ci: Cysharp/Actions/.github/workflows/create-release.yaml 2024-02-07 21:04:48 +09:00
Yoshifumi Kawai
809d23edae Merge pull request #541 from TORISOUP/fix_ToArray
Optimization of ToArray in Merge method
2024-02-04 23:19:47 +09:00
TORISOUP
d38731bc44 fix call ToArray 2024-02-04 20:51:21 +09:00
github-actions[bot]
64792b672d feat: Update package.json to 2.5.3 2024-01-25 12:52:16 +00:00
neuecc
3892cc2299 Merge branch 'master' of https://github.com/Cysharp/UniTask 2024-01-25 21:51:45 +09:00
neuecc
5bfccaa3b6 autoReleaseWhenCancelled -> autoReleaseWhenCanceled 2024-01-25 21:51:40 +09:00
github-actions[bot]
b49b7332bb feat: Update package.json to 2.5.2 2024-01-25 11:43:24 +00:00
neuecc
08184af737 simplify UNITASK define 2024-01-25 20:42:42 +09:00
Yoshifumi Kawai
0ef6c59385 Merge pull request #535 from kochounoyume/valuetask-error-netframework
UniTask does not work in .NET Framework environment after adding UniTask.AsValueTask
2024-01-25 20:26:21 +09:00
Yoshifumi Kawai
4b0bd3b509 Merge pull request #536 from Cysharp/hadashiA/release-handle
Fix "Release handle when cancellation is requested"
2024-01-25 20:26:13 +09:00
Kochoyume
9a4720d180 Fix:Addressed generic parameter attributes error in the .Net Framework 2024-01-25 20:05:45 +09:00
hadashiA
b99646558c Add a flag autoReleaseWhenCancelled to addressable extensionhs 2024-01-25 19:03:00 +09:00
hadashiA
ee12dd9ae7 Fix omissions in Addressable.Release and IsValid checks 2024-01-25 17:47:06 +09:00
Kochoyume
006e0f2c81 Revert "Fix conditional compilation to work with .NET Framework"
This reverts commit 7d31299b5c.
2024-01-25 16:16:01 +09:00
Kochoyume
7d31299b5c Fix conditional compilation to work with .NET Framework 2024-01-25 01:02:57 +09:00
Yoshifumi Kawai
fe8bf834e6 Update README.md 2024-01-24 10:47:31 +09:00
github-actions[bot]
5843258e8c feat: Update package.json to 2.5.1 2024-01-24 01:44:21 +00:00
Yoshifumi Kawai
6cd002645e Merge pull request #533 from doyasu24/feature/add-unitask-asvaluetask-for-unity
add UniTask.AsValueTask for Unity
2024-01-24 10:41:39 +09:00
doyasu24
4fe0861714 fix: use UNITY_2018_3_OR_NEWER instead of UNITY_2018_1_OR_NEWER 2024-01-19 23:42:17 +09:00
doyasu24
fbbba061dd ValueTask is available in Unity 2021_2_OR_NEWER or .NET Core 2024-01-19 23:40:28 +09:00
doyasu24
81f2e37ea5 add UniTask.AsValueTask for Unity 2024-01-19 00:29:21 +09:00
Yoshifumi Kawai
66de0d3a58 Merge pull request #519 from Cysharp/guitarrapc-patch-1
Use Cysharp/Actions/setup-dotnet default version
2024-01-12 15:34:54 +09:00
Yoshifumi Kawai
beb10abbf7 Merge pull request #524 from Saismirk/master
Fixed typo in TimeoutWithoutException summary.
2024-01-12 15:22:35 +09:00
Saismirk
d60f64761b Fixed typo in TimeoutWithoutException summary. 2023-12-10 12:53:52 -05:00
Luciano Prestes Cavalcanti
36ac0863ad Release handle when cancellation is requested 2023-11-22 08:09:03 -03:00
Ikiru Yoshizaki
104f8e09ca Update build-release.yml 2023-11-15 12:09:34 +09:00
Ikiru Yoshizaki
cfbff008c4 Use Cysharp/Actions/setup-dotnet default version
## tl;dr;

It support both .NET 6,7 and 8. No need specify version.
2023-11-15 11:55:27 +09:00
Yoshifumi Kawai
5cc97c7f00 ReadMe 2023-11-02 18:23:43 +09:00
github-actions[bot]
5666292496 feat: Update package.json to 2.5.0 2023-11-02 05:03:47 +00:00
hadashiA
1288cbc128 Merge pull request #518 from Cysharp/hadashiA/awaitable-to-unitask
Add Awaitable.AsUniTask()
2023-11-02 14:02:36 +09:00
hadashiA
5f3aa18f38 Add Awaitable<T>.ToUniTask 2023-11-02 13:54:55 +09:00
hadashiA
0970ae8c31 Merge pull request #517 from Cysharp/hadashiA/cancel-immediately-flag
Add a flag to cancel immediately instead of player loop
2023-11-02 13:52:12 +09:00
hadashiA
ad23f7fb29 Fix #if directive that should be in .tt 2023-11-02 12:54:59 +09:00
hadashiA
a4be8f316e Add Awaitable.AsUniTask() 2023-11-02 12:35:05 +09:00
hadashiA
370425578f Fix AssetBundleRequestAll 2023-11-02 12:24:41 +09:00
hadashiA
1b76f77608 Add test 2023-11-02 12:24:41 +09:00
hadashiA
0579984355 Use AsyncOperation.completed callback usually 2023-11-02 12:24:41 +09:00
hadashiA
39cf81d2ab Add test for unity AsyncOperation 2023-11-02 12:24:41 +09:00
hadashiA
0a203c8db9 Cache Action in advance 2023-11-02 12:24:41 +09:00
hadashiA
55be4dba82 Add callback handler to AsyncOperationConfiguredSource instead to create other sources 2023-11-02 12:24:41 +09:00
hadashiA
f0adf36633 Use AsyncOperation.completed handler with new optional argument 2023-11-02 12:24:41 +09:00
hadashiA
24afc4f3eb Add cancelImmediately flag for assetbundle extensions 2023-11-02 12:24:41 +09:00
hadashiA
2cf06af433 Change AsyncEnumerable factory to use OperationCanceledException 2023-11-02 12:24:36 +09:00
hadashiA
94be2e748b Add cancelImmediately flag for addressable extensions 2023-10-27 15:06:12 +09:00
hadashiA
7f582e5e29 Update README 2023-10-27 14:52:58 +09:00
hadashiA
3f042c8886 Add cancel immediate flag 2023-10-27 12:42:12 +09:00
Yoshifumi Kawai
6f5d818544 Merge pull request #515 from ananttheant/fix/readme-typo
Fix typo in README.md
2023-10-26 13:11:42 +09:00
Anant Sharma
2ccb37cb02 Fix typo in README.md 2023-10-25 15:24:27 +01:00
github-actions[bot]
cfe509a556 feat: Update package.json to 2.4.1 2023-09-21 03:22:58 +00:00
hadashiA
a46a4cac01 Merge pull request #509 from Cysharp/ku/fix-dotween-registration
Fix a bug in Dotween after returning to the pool of `CancellationToken.Register`
2023-09-21 12:20:43 +09:00
hadashiA
3ed28e534a Tweaks 2023-09-21 10:00:27 +09:00
hadashiA
be8dbe8804 Fixed a bug in Dotween after returning to the pool of CancellationToken.Register 2023-09-20 17:35:04 +09:00
github-actions[bot]
64f7eec4e9 feat: Update package.json to 2.4.0 2023-09-14 07:43:41 +00:00
hadashiA
3a93f4a49f Update README.md 2023-09-14 16:40:42 +09:00
hadashiA
71958adc3d Merge pull request #498 from Cysharp/hadashiA/async-linq-merge
Add UniTaskAsyncEnumerable.Merge
2023-09-14 16:28:05 +09:00
hadashiA
acc71550c9 Merge pull request #496 from Cysharp/hadashiA/awaitable
Add EndOfFrame implementation using `UnityEngine.Awaitable`
2023-09-14 16:26:40 +09:00
hadashiA
3ba64412f8 Reduce the lock 2023-09-14 16:26:13 +09:00
hadashiA
90c5e5a6ad Merge pull request #500 from Cysharp/hadashiA/inner-ex2
Use always innerException for Task.AsUniTask
2023-09-14 16:22:09 +09:00
hadashiA
8a022ee02d Merge pull request #499 from Cysharp/hadashiA/fix-completion-source-retval
Fix conditions for UniTaskCompletionSourceCore.TrySet* to be true
2023-09-14 16:12:32 +09:00
hadashiA
6a89ea8139 Merge pull request #503 from Cysharp/hadashiA/fix-auto-reset-source
Add check to that AutoResetUniTaskSource already returned to the pool
2023-09-14 16:10:42 +09:00
hadashiA
90c81613ac Add check to that innerException is empty 2023-09-14 16:08:32 +09:00
hadashiA
7c62904a74 Merge pull request #489 from Merglasch/EarlyInit
Earlier intialization for Unitask, depending on unity version
2023-09-14 15:43:34 +09:00
hadashiA
4f6344a12f Add check to AutoResetUniTaskSource already returned to the pool 2023-09-14 10:36:31 +09:00
hadashiA
937d3adf66 Fix race condition 2023-09-12 14:34:53 +09:00
hadashiA
3bac16229f Reduce lock 2023-09-11 00:22:21 +09:00
hadashiA
ea57847c97 Add dispose 2023-09-09 17:04:02 +09:00
hadashiA
730d68132d Tweaks 2023-09-09 14:27:06 +09:00
hadashiA
6db872236e Fix test 2023-09-09 10:16:01 +09:00
hadashiA
ba7e676c6f Fix test 2023-09-09 10:01:58 +09:00
hadashiA
6e99accf99 Fix race condition (todo: too wide lock range?) 2023-09-09 08:49:52 +09:00
hadashiA
b195df9773 Update README 2023-09-08 20:06:02 +09:00
hadashiA
f303d9d7e8 Add UniTaskAsyncEnumerable.Merge 2023-09-08 20:05:51 +09:00
hadashiA
62a2a2e8f9 Use always innerException for Task.AsUniTask 2023-09-08 18:43:41 +09:00
hadashiA
ffbadbcc4c Update README about WaitForEndOfFrame 2023-09-08 18:00:39 +09:00
hadashiA
50ad2ee9d6 Fix conditions for UniTaskCompletionSourceCore.TrySet* to be true 2023-09-08 17:31:19 +09:00
hadashiA
c170af5642 Merge pull request #487 from Cysharp/hadashiA/fix-test
Fix TriggerEvent problem with iterate breaking on Remove when it has multiple handlers
2023-09-08 17:22:16 +09:00
hadashiA
242bceecd3 Merge pull request #492 from Cysharp/hadashiA/readme
Update README about DOTween
2023-09-08 17:19:30 +09:00
hadashiA
06346b8a2a Merge pull request #493 from Cysharp/hadashiA/monitor
Reduce the times of AwakeMonitor checking
2023-09-08 17:18:50 +09:00
hadashiA
b071eeadfb Merge pull request #486 from Cysharp/hadashiA/inner-ex
Use innerException for `Task.AsUniTask`
2023-09-08 17:17:28 +09:00
hadashiA
e7f23d8328 Merge pull request #497 from Cysharp/hadashiA/net6
Use dotnet >= 6.0
2023-09-08 17:16:36 +09:00
hadashiA
47a3f09abf Merge pull request #485 from Cysharp/hadashiA/fix-dotween
Fix a problem in dotween where an extra update would run after canceling
2023-09-08 17:16:20 +09:00
hadashiA
a7a6af0a68 Fix AwakeMonitor to not duplicates 2023-09-08 09:36:42 +09:00
hadashiA
f203b6c051 Merge pull request #494 from Cysharp/hadashiA/web-req-null-check
Add check if UnityWebRequest was destroyed
2023-09-07 18:13:46 +09:00
hadashiA
07211f1fc3 Bump dotnet version to 6.0/7.0 2023-09-07 18:12:47 +09:00
hadashiA
bc27f6c0d8 Fix test 2023-09-07 17:43:40 +09:00
hadashiA
c65f9c3497 Add EndOfFrame implementation using UnityEngine.Awaitable 2023-09-07 17:36:06 +09:00
hadashiA
afe5f57adc Use CancellationToken.Register to cancel DOTWeen 2023-09-07 17:05:11 +09:00
hadashiA
9135c7ce56 Add check if UnityWebRequest was destroyed 2023-09-07 10:35:48 +09:00
hadashiA
7fae415689 Reduce the times of AwakeMonitor checking 2023-09-07 10:03:55 +09:00
hadashiA
e5cc8667ac docs: update TOC 2023-09-07 00:58:51 +00:00
hadashiA
0ea18d0e16 Update README about DOTween 2023-09-07 09:58:00 +09:00
hadashiA
2d674999f0 Use InnerException when only be one 2023-09-07 09:11:47 +09:00
David Klein
3121903fa3 Earlier intialization for Unitask, depending on unity version 2023-09-04 11:00:50 +02:00
hadashiA
af2e49aa29 Fix TriggerEvent.SetCancel 2023-09-03 20:40:04 +09:00
hadashiA
22940635fe Fix TriggerEvent problem with iterate breaking on Remove when it has multiple handlers 2023-09-02 22:26:09 +09:00
hadashiA
c1042b32b7 Merge pull request #488 from Cysharp/revert-445-fix-wait-async
Revert "Fixed https://github.com/Cysharp/UniTask/issues/444"
2023-09-01 20:08:55 +09:00
hadashiA
29a144694d Revert "Fixed https://github.com/Cysharp/UniTask/issues/444" 2023-09-01 19:52:22 +09:00
hadashiA
548d56e654 Merge pull request #445 from faveris/fix-wait-async
Fixed https://github.com/Cysharp/UniTask/issues/444
2023-09-01 17:06:31 +09:00
hadashiA
6fb4f2d6d2 Support exception unwrapping for AsUniTask of Task.WhenAll 2023-09-01 16:58:11 +09:00
hadashiA
8eac07ad24 Use innerException for Task.AsUniTask 2023-09-01 10:49:43 +09:00
hadashiA
716402a180 Fix a problem in dotween where an extra update would run after canceling 2023-08-31 19:22:17 +09:00
hadashiA
4c3d6938ed Merge pull request #484 from Cysharp/hadashiA/fix-async-enumerable
Fix problem with finally in UniTaskAsyncEnumerable.Create not being executed
2023-08-31 19:17:31 +09:00
hadashiA
b4486802f2 Fix problem with part of await foreach not executing on break 2023-08-31 12:42:53 +09:00
Yoshifumi Kawai
d210e3d76a Merge pull request #457 from sgaumin/wait-for-seconds
Add WaitForSeconds method declarations #371
2023-06-23 19:04:48 +09:00
Ikiru Yoshizaki
f2773f585e Revert "Revert "Merge pull request #459 from Cysharp/feature/prevent""
This reverts commit 305695ad5d.
2023-05-08 12:22:51 +09:00
Ikiru Yoshizaki
305695ad5d Revert "Merge pull request #459 from Cysharp/feature/prevent"
This reverts commit 356a4ee62e.
2023-04-26 14:14:51 +09:00
Ikiru Yoshizaki
418ab36a72 Merge pull request #460 from Cysharp/feature/unity
chore: change unity build to cysharp actions
2023-04-26 12:35:55 +09:00
Ikiru Yoshizaki
563b4fbbd5 chore: remove license 2023-04-25 19:48:54 +09:00
Ikiru Yoshizaki
878d33115f chore: change unity build to cysharp actions 2023-04-25 19:39:40 +09:00
Ikiru Yoshizaki
356a4ee62e Merge pull request #459 from Cysharp/feature/prevent
chote: prevent github workflow change
2023-04-25 18:50:19 +09:00
Ikiru Yoshizaki
eb32ae25e0 chote: prevent github workflow change 2023-04-25 16:56:50 +09:00
Sébastien Gaumin
3ca4062536 Add WaitForSeconds method declarations #371 2023-04-07 00:33:31 +09:00
Artem Kolesnykov
019f8aaf30 Deleted preserveRemoveSelf because Remove() should always remove a trigger for pooling to work correctly 2023-02-12 17:33:19 +02:00
Artem Kolesnykov
663fa737f3 Added a test case for https://github.com/Cysharp/UniTask/issues/444 2023-02-12 17:33:19 +02:00
Yoshifumi Kawai
73d86259ce f 2022-12-26 06:02:57 +09:00
Yoshifumi Kawai
c7eedf85c7 Merge pull request #421 from ivribalko/master
fixed typo in README.md (AysncLocal)
2022-11-21 12:48:07 +09:00
Ivan Rybalko
8dc3ffd552 fixed typo (AysncLocal) 2022-11-10 20:28:07 +00:00
github-actions[bot]
b992a061fb feat: Update package.json to 2.3.3 2022-11-01 11:41:05 +00:00
neuecc
4fc09a6f61 more 2022-11-01 20:40:24 +09:00
neuecc
e57176a43c Merge remote-tracking branch 'origin/master' 2022-11-01 20:39:37 +09:00
Yoshifumi Kawai
710d0d9012 Merge pull request #418 from adarapata/fix-asyncenumerable-cancel
Fix UnityEventHandlerAsyncEnumerator cancellation
2022-11-01 20:39:22 +09:00
neuecc
039de3ef65 Text -> UnityEngine.UI.Text #401 2022-11-01 20:33:24 +09:00
imo
de38f63a55 Token was incorrectly specified. 2022-11-01 20:12:55 +09:00
Yoshifumi Kawai
38f8193199 Update README.md 2022-10-25 13:51:57 +09:00
neuecc
15cffb7357 docs: update TOC 2022-10-25 04:50:13 +00:00
Yoshifumi Kawai
d55748e05b Merge pull request #374 from wqaetly/readme_cn
doc:provide simple chinese readme
2022-10-25 13:50:01 +09:00
NKG丶MadLife
5602861dd4 Update README_CN.md 2022-10-25 12:10:28 +08:00
github-actions[bot]
d2245bc38b feat: Update package.json to 2.3.2 2022-10-24 12:59:01 +00:00
neuecc
f092f6a112 Fix AwaitForAllAssets stackoverflow #394 2022-10-24 21:57:42 +09:00
neuecc
ed617a04a6 if UNITY_2022_2_OR_NEWER, use destroyCancellationToken 2022-10-24 21:56:03 +09:00
neuecc
340736795c UnityEvent.AsAsyncEnumerable handle cancel correctly #365 2022-10-24 21:51:23 +09:00
neuecc
dc804ffb13 breaking changes, UniTask.WaitForFixedUpdate wait at LastFixedUpdate #377 2022-10-24 21:18:36 +09:00
neuecc
a879989d1c Unity 2023.1.0a15, remove AsyncOperation.GetAwaiter to avoid conflict 2022-10-24 21:11:49 +09:00
Yoshifumi Kawai
ee54559532 Merge pull request #413 from battleroy/battleroy/observable-extension-cancellation-token-forwarding
Fix cancellation token forwarding
2022-10-12 10:53:30 +09:00
Evgeny Chasovitin
4a72ec2a1a Fix cancellation token forwarding at FirstValueToUniTaskObserver and ToUniTaskObserver; 2022-10-11 23:01:19 +04:00
Yoshifumi Kawai
e999268305 Merge pull request #395 from kroonhorstdino/diagnostics_helper_null_check
Diagnostics helper null check
2022-09-30 18:49:10 +09:00
Yoshifumi Kawai
8300c1b1e6 Merge pull request #399 from shiena/fix/prevent-nre
fix: prevent NullReferenceException in TimeoutController
2022-09-30 18:04:57 +09:00
KOGA Mitsuhiro
daa0c7b9a0 fix: prevent NullReferenceException in TimeoutController 2022-09-14 02:56:06 +09:00
KOGA Mitsuhiro
9b9a4ec76a fix: prevent NullReferenceException in TimeoutController 2022-09-08 15:12:05 +09:00
Christoph Hüter
3f8e43b83f Remove empty line with spaces 2022-08-31 03:00:22 +02:00
Christoph Hüter
cf6f0799e9 Remove spaces in empty line 2022-08-25 13:51:44 +02:00
Christoph Hüter
91ba4f003a Add null checks to diagnostics helper functions 2022-08-25 13:48:52 +02:00
Yoshifumi Kawai
f48cb4b03e Merge pull request #392 from Ryuu-64/master
Typo in TaskPool.cs annotation internaly -> internally
2022-08-23 10:38:44 +09:00
DESKTOP-FQ830JM\Ryuu
70a243d978 typo in TaskPool.cs internaly -> internally 2022-08-22 12:20:52 +08:00
Yoshifumi Kawai
9b95f3b9f6 Merge pull request #385 from fpagyu/support-addressablesCN
re-define UNITASK_ADDRESSABLE_SUPPORT for supporting Addressables.CN
2022-08-02 10:46:39 +09:00
yuzj
a25adb601b re-define UNITASK_ADDRESSABLE_SUPPORT for supporting Addressables.CN 2022-08-01 18:21:04 +08:00
Ikiru Yoshizaki
e6240879c4 chore: checkout@v3 2022-07-26 15:34:50 +09:00
Ikiru Yoshizaki
a94e8cceac Merge pull request #381 from Cysharp/feature/actions
feat: use Cysharp/Actions reusable workflows/actions
2022-07-26 13:59:46 +09:00
Ikiru Yoshizaki
0595a4182a feat: use Cysharp/Actions for release 2022-07-26 13:10:40 +09:00
Ikiru Yoshizaki
df96c119c1 chore: set timeout 2022-07-26 13:10:32 +09:00
Ikiru Yoshizaki
534f4a2588 chore: use Cysharp/Actions reusable workflow stale 2022-07-26 13:10:22 +09:00
Ikiru Yoshizaki
873485ad1a chore: IsPackable marking 2022-07-26 13:10:10 +09:00
NKG丶MadLife
f6037d6c9b doc:provide simple chinese readme 2022-07-16 10:02:16 +08:00
Yoshifumi Kawai
78db78c7bd Merge pull request #369 from nolimet/bugfix/issue#368
Fix for issue #368 UnityWebRequestException extra line in exception message
2022-06-23 17:46:29 +09:00
Jesse Stam
226e272787 Added simple check to see if there is text.
Add this so we don't add a new line we don't need.
2022-06-23 09:31:05 +02:00
neuecc
9e2163616b Merge remote-tracking branch 'origin/master' 2022-03-03 08:14:22 +09:00
neuecc
52df6fbf3f t 2022-03-03 08:14:18 +09:00
github-actions[bot]
33d32baea4 feat: Update package.json to 2.3.1 2022-03-02 23:02:44 +00:00
neuecc
b0250cfe75 Merge remote-tracking branch 'origin/master' 2022-03-03 08:02:10 +09:00
neuecc
7a35f121cd build and analyzer 2022-03-03 08:02:06 +09:00
github-actions[bot]
79f1566fdb feat: Update package.json to 2.3.0 2022-03-02 22:56:07 +00:00
neuecc
364b67805d test ignore 2022-03-03 07:53:14 +09:00
neuecc
62ca0c6e92 Fix IObservable.ToUniTask does not propagate unobserved exception 2022-03-03 07:40:28 +09:00
neuecc
f63212aa17 ReadMe more 2022-03-03 07:34:49 +09:00
neuecc
768fd16e60 UniTask,Run obsolete 2022-03-03 07:32:15 +09:00
neuecc
3c99010ba0 Add UniTask.WaitForEndOfFrame(MonoBehaviour), Obsolete no args. 2022-03-03 07:22:58 +09:00
neuecc
5c668717d8 Run DelayFrame on UnityEditor 2022-03-03 06:23:34 +09:00
Yoshifumi Kawai
b089f74c65 Merge pull request #323 from SolidAlloy/throw-exception-fix
Fix exceptions never being reported when UniTask is executed without await and Forget()
2022-03-03 06:04:55 +09:00
Yoshifumi Kawai
fcf4f21cc1 Merge pull request #300 from satanabe1/fix-bad_image_format_exception
Fix BadImageFormatException when StackTrace captured on UniTaskTracker
2022-03-03 05:34:07 +09:00
Yoshifumi Kawai
ee2fd3e91d Merge pull request #280 from yellowisher/master
[DoTween]: fix "AwaitFor~" extensions ignore original callback
2022-03-03 05:31:33 +09:00
Yoshifumi Kawai
27604496ca Merge pull request #327 from cjaligaga/patch-1
Update README.md
2022-02-08 10:42:27 +09:00
cjaligaga
0d01034a57 Update README.md
grammar correction to avoid confusion
2021-11-09 13:00:26 +08:00
neuecc
50a67d8f41 r 2021-10-26 19:48:28 +09:00
Yoshifumi Kawai
2a23a85cdd Update README.md 2021-10-26 00:31:02 +09:00
Yoshifumi Kawai
e127d9976e Update README.md 2021-10-25 22:51:58 +09:00
Artem Perepelitsa
c31b78e45e Add a unit test to verify that an unawaited task reports exceptions 2021-10-16 12:18:52 +03:00
Artem Perepelitsa
b6b0b4000d Add unobserved task exception publishing if an exception inside ExceptionResultSource is never thrown 2021-10-16 11:55:30 +03:00
neuecc
69be818a46 AnalyzeSymbol -> AnalyzeOperation 2021-08-27 16:51:39 +09:00
neuecc
a1dee8b54f add experimental analyzer 2021-08-27 16:44:05 +09:00
Yoshifumi Kawai
4f6166102d Merge pull request #285 from Cysharp/chore/xml
chore: add intellisense xml to nuget
2021-07-27 06:26:56 +09:00
Yoshifumi Kawai
6b1d2c231a Merge pull request #284 from Cysharp/chore/setup_dotnet
chore: remove setup-dotnet
2021-07-27 06:26:47 +09:00
watanabe_satoshi
0715dd31bf fix BadImageFormatException 2021-07-05 18:41:31 +09:00
Ikiru Yoshizaki
26dbfa3655 chore: add intellisense xml to nuget 2021-05-24 14:38:36 +09:00
Ikiru Yoshizaki
6ac55e37a1 chore: remove setup-dotnet 2021-05-24 11:01:36 +09:00
Yoshifumi Kawai
60bfbae787 Update package.json 2021-05-11 10:07:23 +09:00
yellowisher
fc9ddeb15c Fix typo 2021-05-08 14:40:02 +09:00
yellowisher
dfe18d11ff [DoTween]: call original complete callback as well 2021-05-08 14:39:26 +09:00
Yoshifumi Kawai
958a8e11ab Merge pull request #266 from oktomus/patch-1
Fix wording and code instructions for -batchmode usage
2021-04-21 16:51:30 +09:00
Kevin Masson
257186313b Fix wording and code instructions for -batchmode usage
`Environment.Exit(0)` didn't work for me, the process was still running. `EditorApplication.Exit(0);` works and kills the `Unity Editor` process correctly.
2021-04-20 14:31:16 +02:00
Ikiru Yoshizaki
5bd508b31c shore: skip ci supported by default 2021-04-19 18:47:10 +09:00
Yoshifumi Kawai
9e18ba332e Update README.md 2021-04-18 11:26:35 +09:00
Yoshifumi Kawai
946b9003f0 Update README.md 2021-04-13 19:03:58 +09:00
Yoshifumi Kawai
ffa55becf3 Update README.md 2021-04-13 14:09:32 +09:00
github-actions[bot]
72e620d169 feat: Update package.json to 2.2.5 2021-04-06 04:33:51 +00:00
github-actions[bot]
10ebddf892 Revert "feat: Update package.json to 2.2.5"
This reverts commit 4fc9ca315e.
2021-04-06 13:33:09 +09:00
neuecc
c51e45ee21 Merge remote-tracking branch 'origin/master' 2021-04-06 13:32:36 +09:00
neuecc
6968faf35b remove remove 2021-04-06 13:32:31 +09:00
github-actions[bot]
4fc9ca315e feat: Update package.json to 2.2.5 2021-04-06 04:24:55 +00:00
neuecc
aaf1c0eaa1 assembly signed 2021-04-06 13:23:56 +09:00
neuecc
44ce3c96bb en-us docs 2021-04-06 13:17:11 +09:00
Yoshifumi Kawai
03097f08e2 Merge pull request #259 from hadoumune/patch-1
fix typo unitySynchronizationContext
2021-04-06 13:11:28 +09:00
Yoshifumi Kawai
af82dd719e Merge pull request #260 from euglenach/master
fix typo in README.md
2021-04-06 13:11:03 +09:00
neuecc
ecd3625a08 Fix UniTaskAsyncEnumerable.Prepend does not work, #251 2021-04-06 13:08:18 +09:00
neuecc
da8f599ccb fix unittest more 2021-04-06 13:05:52 +09:00
neuecc
aa3216e48d fix invalid unit tests(BeEquilvalentTo -> Equal) 2021-04-06 13:02:50 +09:00
Euglenach
5f7148419f fix typo in README.md
Enumerbale → Enumerable
2021-04-06 00:31:18 +09:00
Ikiru Yoshizaki
89ae106ea7 fix: release tag update when package.json has change 2021-04-05 11:06:40 +09:00
hatomune
721a7d9e4e fix typo unitySynchronizationContext
When I was following the context switch flow, I found a typo, so I fixed it.
2021-04-04 01:17:23 +09:00
github-actions[bot]
18f2746f0d feat: Update package.json to 2.2.4 2021-03-12 07:36:32 +00:00
Yoshifumi Kawai
8a10f2191f Merge pull request #243 from Cysharp/playerloop-timer
Add PlayerLoopTimer
2021-03-12 16:07:11 +09:00
neuecc
8b3c8d15c4 PlayerLoopTimer unit test and fixes 2021-03-12 16:06:42 +09:00
neuecc
49ca9364f7 TimeoutController uses PlayerLoopTimer(WIP, needs test) 2021-03-12 13:01:46 +09:00
neuecc
62f6429b60 add PlayerLoopTimer 2021-03-12 11:35:46 +09:00
neuecc
b6a9836e81 WIP, playerlooptimer 2021-03-11 17:56:41 +09:00
github-actions[bot]
be34d8abf4 feat: Update package.json to 2.2.3 2021-03-02 06:19:55 +00:00
neuecc
9af15d7ab3 Merge remote-tracking branch 'origin/master' 2021-03-02 15:16:07 +09:00
neuecc
308fef2859 Fix: UniTask(not generics).ToObservable does not return error when task
Fix: UniTask(not generics).ToObservable does not return OnError when task status is already faulted or canceled
2021-03-02 15:16:00 +09:00
github-actions[bot]
3cc0c80b1e feat: Update package.json to 2.2.2 2021-03-02 02:02:01 +00:00
neuecc
cdda33a98e Add UniTask.Yield(CancellationToken), NextFrame(CancellationToken) 2021-03-01 19:08:40 +09:00
github-actions[bot]
e57a4332ec feat: Update package.json to 2.2.1 2021-02-26 09:52:12 +00:00
neuecc
e88e553cc9 2.2.1 2021-02-26 18:51:35 +09:00
github-actions[bot]
a1a38d0d7c feat: Update package.json to 2.2.0 2021-02-26 07:47:03 +00:00
Yoshifumi Kawai
c9bebd6550 Merge pull request #238 from Cysharp/custom-loop-injector
Ver 2.2.0
2021-02-26 16:42:54 +09:00
neuecc
42047070dd more ci 2021-02-26 11:42:30 +09:00
neuecc
316f3bd963 cm 2021-02-26 11:00:47 +09:00
neuecc
5f96e646d4 netcore 2021-02-26 10:27:22 +09:00
neuecc
186114996c docs: update TOC 2021-02-25 13:13:40 +00:00
neuecc
841b6e85ae fix 2021-02-25 22:13:14 +09:00
neuecc
7ac9853cf6 (BreakingChange)AsyncOperation.WithCancellation same ToUniTask(ctoken) 2021-02-25 22:11:18 +09:00
neuecc
0ec45b9da6 (Breaking Changed)UniTask.WithCancellation -> IgnoreWhenCanceled 2021-02-25 21:56:52 +09:00
neuecc
dfd0fe9fe4 Add TimeoutController 2021-02-25 20:30:44 +09:00
neuecc
4710268e0a Add PlayerLoopHelper.Initialize(InbjectPlayerLoopTimings) 2021-02-25 19:26:37 +09:00
neuecc
cae512e4de Delay automatically fallback to Realtime when run on EditMode #234 2021-02-25 19:25:48 +09:00
neuecc
6351d4c5a4 test1 2021-02-25 11:12:15 +09:00
github-actions[bot]
1173bb4f34 feat: Update package.json to 2.1.2 2021-02-08 10:44:53 +00:00
neuecc
e4272b5337 one more back to 2.1.1 2021-02-08 19:43:57 +09:00
neuecc
b660506e31 com.unity.modules.unitywebrequest 2021-02-08 19:43:32 +09:00
github-actions[bot]
2c101aef08 feat: Update package.json to 2.1.2 2021-02-08 10:37:58 +00:00
neuecc
498b2a4f81 Merge remote-tracking branch 'origin/master' 2021-02-08 19:37:25 +09:00
neuecc
a8c2fd420a back to 2.1.1 2021-02-08 19:37:09 +09:00
Yoshifumi Kawai
dade7fdc76 Merge pull request #230 from Cysharp/fix/checkout_version
chore: fix checkout version on unity
2021-02-08 19:34:19 +09:00
Ikiru Yoshizaki
1c8b16f798 chore: fix checkout version on unity 2021-02-08 19:32:53 +09:00
neuecc
89649d8777 remove unity generate csproj 2021-02-08 19:22:54 +09:00
github-actions[bot]
9894bf875b feat: Update package.json to 2.1.2 2021-02-08 10:14:07 +00:00
Yoshifumi Kawai
45a800330b Merge pull request #229 from Cysharp/moreasmdef
define UNITASK_PHYSICS_SUPPORT, UNITASK_PHYSICS2D_SUPPORT, UNITASK_PARTICLESYSTEM_SUPPORT, UNITASK_UGUI_SUPPORT, UNITASK_WEBREQUEST_SUPPORT
2021-02-08 19:11:00 +09:00
neuecc
a35e5f929d UNITASK_WEBREQUEST_SUPPORT 2021-02-08 19:09:02 +09:00
neuecc
9a3f10d4bf versionDefines for physics etc. 2021-02-08 18:08:56 +09:00
Ikiru Yoshizaki
19b5f921a1 chore: add original cli command 2021-02-08 16:53:46 +09:00
Yoshifumi Kawai
8cd577904e Merge pull request #228 from Cysharp/chore/image
chore: new docker image to build
2021-02-08 16:16:56 +09:00
Ikiru Yoshizaki
309d661bcc fix: actions name update to game-ci/unity-builder 2021-02-08 16:08:43 +09:00
Ikiru Yoshizaki
8736024d9b Merge branch 'master' into chore/image 2021-02-08 15:54:18 +09:00
Ikiru Yoshizaki
97680e57a8 chore: new unity build with unityci/editor 2021-02-08 15:54:07 +09:00
Yoshifumi Kawai
638522600a Merge pull request #220 from taigacon/master
Fix using AsyncUnityEventHandler with a already canceled token
2021-02-08 14:51:21 +09:00
Yoshifumi Kawai
081113a62c Merge pull request #224 from neilsarkar/master
Grammar edits for README.md
2021-02-08 14:01:03 +09:00
Ikiru Yoshizaki
7535c84581 chore: use unity-editor 2021-02-08 11:47:14 +09:00
Ikiru Yoshizaki
690f3a2ead chore: move 2020.1 beta to ga image 2021-02-08 11:36:39 +09:00
Ikiru Yoshizaki
88371d08b9 chore: new docker image to build 2021-02-08 11:26:31 +09:00
Yoshifumi Kawai
6d382450cf Merge pull request #226 from Cysharp/chore/release
chore: release on workflow_dispatch
2021-02-08 11:22:27 +09:00
Ikiru Yoshizaki
19f2a6f282 chore: pr build should run for master only 2021-02-04 03:01:21 +09:00
Ikiru Yoshizaki
7ed0b016ea chore: release on workflow_dispatch 2021-02-04 02:59:52 +09:00
Ikiru Yoshizaki
f72a51e13d chore: detect forgotten .meta file commit 2021-02-04 02:58:29 +09:00
Neil Sarkar
0e2dbbe754 Minor copyedit
`AsyncOpereationHandle<T>` -> `AsyncOperationHandle<T>`
2021-02-03 10:25:35 -05:00
Neil Sarkar
cff51a0425 Minor copyedit
oldest version -> lowest version
2021-02-03 10:18:32 -05:00
Neil Sarkar
7cac4bbbab Grammar fixes for README.md 2021-02-03 10:07:32 -05:00
taigacon
3f4a46bca6 Fix using AsyncUnityEventHandler with a already canceled token 2021-01-25 20:02:56 +08:00
neuecc
7d21a75ea8 2.1.1 2021-01-20 17:37:32 +09:00
neuecc
88817b7093 fix Coroutine.ToUniTask breaks pooling when coroutine return immediately 2021-01-20 17:31:55 +09:00
neuecc
52cdadc035 u 2021-01-07 17:43:35 +09:00
neuecc
5401b9b227 ready for release 2.1.0 2021-01-07 17:28:09 +09:00
neuecc
38de930f81 s 2021-01-07 17:25:03 +09:00
neuecc
9be6ef7ba6 new PlayerLoopType detector supports before 2019_4 2021-01-07 17:18:21 +09:00
neuecc
739bc6e26c add stale 2021-01-07 16:59:38 +09:00
neuecc
71879266ac Fix DelayType.Realtime does not work when use BuildPlayer in UnityEditor 2021-01-07 16:40:41 +09:00
neuecc
5ced0a1d4b Add UnityWebRequestException.ResponseHeaders #198 2021-01-07 16:03:27 +09:00
neuecc
908e361985 Add PlayerLoopTiming.TimeUpdate/LastTimeUpdate in Unity 2020.2 2021-01-07 13:02:18 +09:00
neuecc
797affae4d throw 2021-01-07 12:09:55 +09:00
Yoshifumi Kawai
ae3b825e29 Merge pull request #210 from WallyCZ/2020.2_fix
Unity 2020.2 changed order of the PlayerLoop subsystem list (should fix #208)
2021-01-07 12:01:11 +09:00
neuecc
143d97a73b update version 2021-01-07 11:59:31 +09:00
Václav Lipert
90631c54b1 More robust finding of right player loop system 2021-01-06 23:32:23 +01:00
Yoshifumi Kawai
478e2998a8 Merge pull request #204 from piti6/fix-defer
Accept calling DeferPromise.GetStatus multiple times
2021-01-06 17:45:28 +09:00
Yoshifumi Kawai
9406305b2e Merge pull request #203 from RamType0/FixCompletedTaskAsUniTaskAllocating
Suppress allocations around UniTask<T>.AsUniTask and UniTask.AsAsyncUnitUniTask
2021-01-06 17:19:19 +09:00
Václav Lipert
1c26c81b20 2020.2 changed PlayerLoopSystem order fix 2021-01-03 00:29:00 +01:00
RamType0
a455de88b0 Suppress allocations around UniTask<T>.AsUniTask and UniTask.AsAsyncUnitUniTask
- Fix completedTask.AsUniTask or completedTask.AsAsyncUnitUniTask leaks IUniTaskSource
- UniTask.AsAsyncUnitUniTask no longer allocates when its inner IUniTaskSource is IUniTaskSource<AsyncUnit>
2020-12-17 14:28:10 +09:00
piti6
fba6942d5f Accept GetStatus calling multiple times 2020-12-17 12:31:43 +09:00
Yoshifumi Kawai
3115efb672 Merge pull request #196 from RamType0/ForceCompleteJobHandleOnApplicationQuit
Force complete awaiting JobHandles when quitted in UnityEditor
2020-11-25 09:00:21 +09:00
Ram.Type-0
fd70c031cb Force complete awaiting JobHandles when quitted in UnityEditor 2020-11-24 23:50:01 +09:00
neuecc
a2eb75df68 Merge remote-tracking branch 'origin/master' 2020-11-09 16:08:20 +09:00
neuecc
4a62d7eba6 2.0.37 2020-11-09 16:08:17 +09:00
Yoshifumi Kawai
40d2d2fe06 Merge pull request #189 from IllusionCui/master
[DoTween]:fix CancellationToken can't stop UniTask
2020-11-09 15:52:13 +09:00
neuecc
d5d2cb5937 use Dictionary instead of ConcurrentDictionary for safety of WebGL build, #179 2020-11-09 14:34:11 +09:00
neuecc
854100c075 fix invalid usage of SpinLock, #195 2020-11-09 14:20:03 +09:00
cuibeibei
5837b26208 [DoTween]:fix CancellationToken can't stop UniTask 2020-10-28 18:48:10 +08:00
Yoshifumi Kawai
da0e654e7d Merge pull request #183 from Cysharp/chore/github_Actions_security_fix
chore: replace set-env to ENV FILE $GITHUB_ENV
2020-10-14 12:39:48 +09:00
Ikiru Yoshizaki
a3e9932be7 chore: replace set-env to ENV FILE $GITHUB_ENV
fix https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
2020-10-14 12:12:28 +09:00
neuecc
e82353b4d9 UNITY_WEBGL unittest 2020-10-07 10:38:27 +09:00
Yoshifumi Kawai
944b61f28c Update README.md 2020-09-25 17:32:17 +09:00
Yoshifumi Kawai
457c574865 Update README.md 2020-09-24 10:31:59 +09:00
Yoshifumi Kawai
089a509663 Update README.md 2020-09-23 17:16:09 +09:00
neuecc
3bebaef969 2.0.36 2020-09-22 10:49:04 +09:00
neuecc
37e8b4500e Add enumerator.ToUniTask(MonoBehaviour coroutineRunner), log WARN on await enumerator when yield not supported types(Coroutine, WaitForEndOfFrame, WaitForFixedUpdate). 2020-09-22 10:08:03 +09:00
neuecc
8537ddf8a6 fix Forget when source is already completed and source is manualy optimized task source, does not work correctly 2020-09-22 09:54:05 +09:00
neuecc
346b1e0a6b 2.0.35 2020-09-21 12:56:13 +09:00
neuecc
fc7b9660a5 remove OnMouse_event trigger to prevent warning on Andoird, iOS, #170 2020-09-21 12:50:25 +09:00
neuecc
21e5cc22c7 notice for WaitForEndOfFrame #169 2020-09-21 12:49:26 +09:00
neuecc
3f18b37e5f changed clear loop runner queue timing in UnityEditor and run rest action when quitted 2020-09-21 12:30:31 +09:00
neuecc
5d4a90e9bd fix broken loop-runner from 2.0.32, #172 2020-09-21 11:42:02 +09:00
neuecc
2bf9f4f062 fix 2020-09-16 09:58:30 +09:00
neuecc
d69490cb49 one more things 2020-09-16 09:55:14 +09:00
neuecc
4e460c11ca 2.0.34 2020-09-16 09:48:57 +09:00
neuecc
9313969314 2.0.33 2020-09-15 06:53:58 +09:00
neuecc
a40f89a922 Merge remote-tracking branch 'origin/master' 2020-09-15 06:35:28 +09:00
neuecc
e0d8410b62 fix IEnumerator.ToUniTask, does not work correctly when coroutine complete immediately 2020-09-15 06:35:22 +09:00
Yoshifumi Kawai
bef1bd8ad1 Merge pull request #164 from c0nd3v/master
Fixed AwaitForAllAssets()
2020-09-12 06:09:29 +09:00
c0nd3v
81b4fcfac1 Fixed AwaitForAllAssets() 2020-09-11 10:41:41 -04:00
Yoshifumi Kawai
f1e4a3c65d Merge pull request #162 from hikarin522/patch-3
Fix UniTaskExtensions.Unwrap()
2020-09-09 15:38:03 +09:00
hikari
65622b01f6 [Unwrap] add ConfigureAwait 2020-09-09 14:15:03 +09:00
hikari
87dd5f13fd [Unwrap()] fix: remove type parameter 2020-09-09 14:05:37 +09:00
Yoshifumi Kawai
79cd2c17ba Update README.md 2020-09-07 18:55:44 +09:00
neuecc
85fb08552e Merge remote-tracking branch 'origin/master' 2020-09-07 18:52:22 +09:00
neuecc
7bd4b6faf7 2.0.32 2020-09-07 18:52:11 +09:00
neuecc
0b1ae7e295 docs: update TOC 2020-09-07 08:56:35 +00:00
neuecc
35a893ad9e Add UniTask.RunOnThreadPool 2020-09-07 17:56:02 +09:00
Yoshifumi Kawai
4955ed18f1 Merge pull request #157 from RamType-0/OptimizeConsumeEnumerator
Optimize EnumeratorPromise.ConsumeEnumerator while consuming CustomYieldInstruction
2020-09-07 17:23:08 +09:00
Yoshifumi Kawai
fe462328ab Merge pull request #148 from RamType-0/TaskPoolNodeByRef
Use ref T for ITaskPoolNode<T>.NextNode
2020-09-07 15:33:22 +09:00
Yoshifumi Kawai
5136d92efa Merge pull request #147 from RamType-0/OptimizeInternalContinuationIteration
Optimize ContinuationQueue and PlayerLoopRunner iteration
2020-09-07 15:32:50 +09:00
RamType0
227f7872cb Remove comments 2020-09-02 13:19:11 +09:00
Ram.Type-0
725b2fdc35 Format comment 2020-09-01 21:25:43 +09:00
Ram.Type-0
75abc8059f Optimize EnumeratorPromise.ConsumeEnumerator while consuming CustomYieldInstruction 2020-09-01 21:18:13 +09:00
RamType0
f1193743c8 Remove deprecated comment 2020-09-01 11:53:10 +09:00
Ram.Type-0
109730eacd Add missing migration from previous one 2020-08-30 14:18:55 +09:00
Ram.Type-0
1f736afe86 Revert change for ContinuationQueue.RunCore 2020-08-30 13:53:29 +09:00
Yoshifumi Kawai
4d554a6718 Merge pull request #149 from RamType-0/PlayerLoopRunnerInitializationFix
Fix PlayerLoopRunner at PlayerLoopTiming.Initialization is not assigned to PlayerLoopHelper.runners[0]
2020-08-30 09:49:19 +09:00
Ram.Type-0
69c0c362e9 Fix PlayerLoopRunner at PlayerLoopTiming.Initialization is not assigned to PlayerLoopHelper.runners[0] 2020-08-28 21:15:45 +09:00
RamType0
3bb446556a Use ref T for ITaskPoolNode<T>.NextNode 2020-08-28 18:03:22 +09:00
RamType0
ea950d8cec Optimize ContinuationQueue and PlayerLoopRunner iteration
- Fix failing to eliminate array bounds check in PlayerLoopRunner.RunCore
- Reduce number of array bounds check of continuation iteration in ContinuationQueue.RunCore
2020-08-28 17:12:03 +09:00
Yoshifumi Kawai
a65f4da7a2 Merge pull request #145 from RamType-0/TaskPoolNodeBenchmark
Add TaskPoolRefNode benchmark
2020-08-28 11:15:57 +09:00
Ram.Type-0
0bdc933c20 Add TaskPoolRefNode benchmark 2020-08-28 10:54:33 +09:00
Yoshifumi Kawai
0c0f79c6db Merge pull request #142 from hikarin522/patch-2
Add UniTaskExtensions.Unwrap()
2020-08-28 04:51:16 +09:00
hikari
32f9b9d4ac add Unwrap 2020-08-26 15:59:40 +09:00
neuecc
53907a3719 Merge remote-tracking branch 'origin/master' 2020-08-25 07:16:16 +09:00
neuecc
4937aeee3f 2.0.31 2020-08-25 07:16:08 +09:00
Yoshifumi Kawai
5e5b8aff89 Merge pull request #140 from hikarin522/patch-1
Fix ToCancellationToken
2020-08-25 07:13:56 +09:00
Yoshifumi Kawai
a2cbbd82d0 Merge pull request #139 from Cysharp/feature/SubscribeAwait
Add UniTaskAsyncEnumerable.SubscribeAwait
2020-08-25 07:12:00 +09:00
Yoshifumi Kawai
7eac5d8ba8 Merge pull request #138 from Cysharp/hotfix/ContinueOnErrorCallingOnNext
Continue to subscribe if an exception is raised when calling onNext
2020-08-25 07:11:43 +09:00
Yoshifumi Kawai
e2b1ed55ae Merge pull request #134 from SeungHuLee/Add-TMP-Generic-BindTo
Add TMP Generic BindTo Support
2020-08-25 07:11:26 +09:00
neuecc
727c7102d3 Add more DoTween support - AwaitForComplete, AwaitForPause, AwaitForPlay, AwaitForRewind, AwaitForStepComplete. 2020-08-25 07:10:39 +09:00
neuecc
1494ea6717 removelog spam on UniTaskAsyncEnumerable.EveryValueChanged #141 2020-08-25 06:43:31 +09:00
neuecc
f1ce64dbd3 middleware sample 2020-08-25 06:43:03 +09:00
hikari
3bad5cd2bf fixup! Fix ToCancellationToken linkToken 2020-08-25 02:55:09 +09:00
hikari
7432c0073a Fix ToCancellationToken linkToken 2020-08-24 17:10:26 +09:00
Mayuki Sawatari
f1813a7c94 Continue to subscribe if an exception is raised when calling onNext 2020-08-24 14:44:48 +09:00
Mayuki Sawatari
9e45c0a4d1 Add UniTaskAsyncEnumerable.SubscribeAwait 2020-08-24 14:35:20 +09:00
LSH
2c652cdde7 Add TMP Generic BindTo Support 2020-08-20 03:30:41 +09:00
neuecc
7718d345c8 2.0.30 2020-08-14 17:36:50 +09:00
neuecc
9f39708325 Merge remote-tracking branch 'origin/master' 2020-08-14 17:29:39 +09:00
neuecc
bb6dbfa920 Fix await IEnumerator + WaitForSeconds does not follow timescale(to behave same as StartCoroutine) #133 2020-08-14 17:29:30 +09:00
Yoshifumi Kawai
ba265005bb Merge pull request #132 from RamType-0/Disable-AutoReference-EditorAssembly
Disable "Auto Referenced" of UniTask.Editor
2020-08-14 06:25:21 +09:00
Ram.Type-0
4d7cc7ed61 Disable auto reference of UniTask.Editor 2020-08-14 04:56:58 +09:00
neuecc
b64f31eb0b 2.0.28 2020-08-13 17:44:15 +09:00
neuecc
38d159b69e IEnumerator.ToUniTask() behave same as StartCoroutine #120 2020-08-13 17:44:06 +09:00
neuecc
d5455f3716 Merge remote-tracking branch 'origin/master' 2020-08-13 16:33:41 +09:00
neuecc
a72ceeba11 UNITASK_ASSETBUNDLE_SUPPORT #131 2020-08-13 16:33:32 +09:00
Yoshifumi Kawai
c6b7d332b2 Update README.md 2020-08-12 11:41:21 +09:00
neuecc
f37278f2a6 docs: update TOC 2020-08-12 02:23:09 +00:00
Yoshifumi Kawai
3f3e03b83d Update README.md 2020-08-12 11:22:52 +09:00
Yoshifumi Kawai
c99d3eb3c3 Update README.md 2020-08-05 15:55:09 +09:00
Yoshifumi Kawai
08d5183e7e Merge pull request #121 from Cysharp/chore/unity_activation
chore: remove generate unity alf (activation license file)
2020-08-04 14:54:50 +09:00
Ikiru Yoshizaki
51769b2224 chore: remove generate unity alf (activation license file) 2020-08-04 13:20:33 +09:00
neuecc
6ec0ed8d61 docs: update TOC 2020-07-29 23:18:59 +00:00
neuecc
2e35324403 ready for 2.0.27 2020-07-30 08:12:32 +09:00
neuecc
e9474649c4 Add AssetBundleRequest.AwaitForAllAssets 2020-07-30 08:12:24 +09:00
neuecc
a8e0ce50c8 Fix Addressables async extensions when autoReleaseHandle: true 2020-07-30 08:12:03 +09:00
neuecc
db7ddba735 Add UniTaskSynchronizationContext, PlayerLoopHelper.IsInjectedUniTaskPlayerLoop, DumpCurrentPlayerLoop 2020-07-30 08:11:07 +09:00
neuecc
1999d94b33 Add UniTask.WithCancellation 2020-07-30 08:10:16 +09:00
neuecc
44af123b6c Update project version to 2019.4.5f1 2020-07-30 07:01:29 +09:00
neuecc
547b700ba7 AsyncOperation/Addressables returns Cacnceled UniTask when already canceled. 2020-07-16 06:12:39 +09:00
neuecc
6b87d5d2b0 2.0.26 2020-07-16 06:05:04 +09:00
neuecc
023894d45e Merge remote-tracking branch 'origin/master' 2020-07-16 05:37:08 +09:00
Yoshifumi Kawai
009715c0da Merge pull request #115 from IllusionCui/master
[addressable]:fix CancellationToken can't stop UniTask #114
2020-07-16 05:37:01 +09:00
neuecc
c2824027d4 more strict handle cancel timing on asyncOperation.WithCancellation() 2020-07-16 05:36:21 +09:00
cuibeibei
65b6553a1a [addressable]:fix CancellationToken can't stop UniTask #114 2020-07-15 15:14:08 +08:00
neuecc
9d3b7adc8e Add CancellationToken cancellationToken = default to UniTask.Run #113 2020-07-14 11:25:30 +09:00
neuecc
3724fc204c memo of IL2CPP VM bug. 2020-07-14 06:40:32 +09:00
neuecc
b97451a915 UnityWebRequest, Addressables returns exception when already isDone and AsyncOperation has error. 2020-07-13 09:34:43 +09:00
neuecc
9ddcac4c6c ignore1 2020-07-13 01:00:16 +09:00
neuecc
b61e3c347f remove unity csproj 2020-07-11 02:19:40 +09:00
neuecc
0bb44066c0 2.0.25 2020-07-09 22:39:48 +09:00
neuecc
305c4aaa07 fix UnityWebRequestException String access is not supported #110 2020-07-09 22:17:49 +09:00
neuecc
42d627f3ba fix again #108 2020-07-09 17:29:04 +09:00
neuecc
6dd2b464a3 NRE on head request with invalid url #108 2020-07-09 01:31:27 +09:00
neuecc
32f24cf8f8 cleanup unused code 2020-07-04 22:08:48 +09:00
neuecc
4a89e3ea86 r 2020-07-04 06:44:57 +09:00
neuecc
887db5b281 2.0.24 2020-07-04 06:36:14 +09:00
neuecc
fee5518a82 Improve, Select/Where add UniTaskTracker 2020-07-04 06:29:50 +09:00
neuecc
551128e64c Add UniTaskAsyncEnumerable.Create 2020-07-04 06:29:33 +09:00
neuecc
c65ae8d18e error detail 2020-07-04 06:29:08 +09:00
neuecc
c1f75d9ebd Add UniTask.Never 2020-06-30 04:01:00 +09:00
neuecc
73a5ff6648 r 2020-06-29 03:24:10 +09:00
neuecc
1c264f380e 2.0.23 2020-06-29 03:22:33 +09:00
neuecc
f02bfa0a1e Fix lose exception stacktrace info when task is sync completed 2020-06-29 03:20:13 +09:00
neuecc
9d684006fc test 2020-06-29 03:02:23 +09:00
neuecc
c49f1ed028 r 2020-06-29 01:18:16 +09:00
neuecc
d935b226c0 2.0.22 2020-06-29 01:13:37 +09:00
neuecc
d9e20de8a5 Add UniTaskAsyncEnumerable.SkipUntil, TakeUntil. Fix SkipUntilCanceled behaviour. 2020-06-29 01:10:18 +09:00
neuecc
23997f0f93 SwitchToMainThread, ReturnToMainThread, SwitchToSynchronizationContext, ReturnToSynchronizationContext supports CancellationToken 2020-06-28 20:57:42 +09:00
neuecc
529272d11b more ignore 2020-06-28 18:01:01 +09:00
neuecc
1194c38568 Add AsyncGPUReadbackRequest await support 2020-06-28 17:59:03 +09:00
neuecc
f0d2ee2beb typo 2020-06-26 17:57:27 +09:00
neuecc
68cdda086a async UniTaskVoid Start 2020-06-26 17:53:07 +09:00
neuecc
54ceca6ceb R 2020-06-25 23:03:13 +09:00
neuecc
50bdf7460c 2.0.21 2020-06-25 23:02:40 +09:00
neuecc
c06e45d0bb ToCancellationToken(linkeToken) 2020-06-25 23:02:30 +09:00
neuecc
3ed6e28a00 Removed Timeout(bool ignoreTimeScale), changed to Timeout(DelayType delayType) 2020-06-25 22:35:55 +09:00
neuecc
ab76098895 Removed CancelAfterSlim(bool ignoreTimeScale), changed to CancelAfterSlim(DelayType delayType) 2020-06-25 22:35:35 +09:00
neuecc
0a447e43b0 Add UniTask.ToCancellationToken 2020-06-25 22:34:45 +09:00
neuecc
8df44f2768 Remove UniTask.DelayRealtime, Add UniTask.Delay(DelayType) overload 2020-06-25 22:15:44 +09:00
neuecc
a7ec64d644 more 20 2020-06-24 05:09:00 +09:00
neuecc
868e104d85 2.0.20 2020-06-24 05:04:18 +09:00
neuecc
7ced7f5764 separate external assemblies, add TMP_InputField extensions 2020-06-24 05:04:09 +09:00
neuecc
12b39c6ba1 Add UniTask.DelayRealtime 2020-06-24 01:40:43 +09:00
neuecc
93df9d7693 Prevent -> Preserve in ReadMe 2020-06-21 23:11:47 +09:00
neuecc
3980f314fa Fix UnityWebRequestExtensions obsolete warning in Unity 2020.2 2020-06-19 16:46:30 +09:00
neuecc
c2538da1cd Improve UnityWebRequestError performance 2020-06-19 16:45:55 +09:00
neuecc
5ed943bca2 Add UniTask.Post 2020-06-19 16:42:05 +09:00
neuecc
d6a0563319 ready 2.0.19 2020-06-18 03:39:44 +09:00
neuecc
af82a94b87 Fix TimeoutWithoutException does not suppress exception 2020-06-18 03:30:53 +09:00
neuecc
82219e6111 Fix UniTask.Delay does not run on threadpool thread 2020-06-18 03:28:03 +09:00
neuecc
81f9c55c7f Add UniTask.Run(Func<UniTask>) overload 2020-06-18 03:27:26 +09:00
neuecc
0640f278cc Fix AsyncLazy can not await multiple times when task is not completed 2020-06-18 03:02:01 +09:00
neuecc
769b5c6bab UniTaskCompletionSource can await multiple times(same behaviour as TaskCompletionSource) 2020-06-18 02:34:56 +09:00
neuecc
bdd569e213 fix can not close application in mono build 2020-06-17 21:37:45 +09:00
neuecc
5bfff5bc24 Subscribe ReadMe 2020-06-15 22:46:01 +09:00
neuecc
edf32496e4 re 2020-06-15 15:29:12 +09:00
neuecc
785f5837d1 Merge remote-tracking branch 'origin/master' 2020-06-15 15:28:29 +09:00
neuecc
8c9272bc9f 2.0.18 2020-06-15 15:26:28 +09:00
neuecc
3e00735b3d Add AsUniTaskAsyncEnumerable/AsAsyncEnumerable in .NET Core 2020-06-15 15:23:25 +09:00
neuecc
00a1be8666 await UnityWebRequestAsyncOperation throws UnityWebRequestException when isHttpError or isNetworkError 2020-06-15 15:23:07 +09:00
neuecc
a2783d3c8a yes meta 2020-06-15 12:29:46 +09:00
Yoshifumi Kawai
85d1a8a4a4 Update README.md 2020-06-14 15:44:40 +09:00
neuecc
bbfb8354bb 2.0.17 2020-06-14 15:32:37 +09:00
Yoshifumi Kawai
2f68e47443 Merge pull request #92 from yashihei/fix-cancellation-token
Fixed CancelationToken not being passed correctly
2020-06-14 15:08:37 +09:00
yashihei
89339ffb29 Fixed CancelationToken not being passed correctly 2020-06-14 08:24:25 +09:00
neuecc
0535862fe6 Merge remote-tracking branch 'origin/master' 2020-06-13 18:58:56 +09:00
neuecc
a9e5fd4589 Add UniTaskAsyncEnumerable.Subscribe 2020-06-13 18:58:43 +09:00
Yoshifumi Kawai
a3f3a28ea1 Update README.md 2020-06-12 17:18:31 +09:00
Yoshifumi Kawai
59020df965 Update README.md 2020-06-12 17:18:22 +09:00
Yoshifumi Kawai
ac01be79bf Update README.md 2020-06-12 16:59:14 +09:00
neuecc
de5951f208 lock q 2020-06-12 10:46:29 +09:00
neuecc
ded9a561db 2.0.16 2020-06-12 03:16:06 +09:00
neuecc
a2c18eb343 AsyncReactiveProperty document 2020-06-11 23:50:13 +09:00
neuecc
0b27c3a342 Merge remote-tracking branch 'origin/master' 2020-06-11 23:32:00 +09:00
neuecc
9c86cfb508 Add IDisposable.AddTo(cancellationToken) 2020-06-11 23:31:55 +09:00
Yoshifumi Kawai
7e5e6ed6c2 Update README.md 2020-06-11 20:21:51 +09:00
Yoshifumi Kawai
d081e5f40b Update README.md 2020-06-11 17:48:41 +09:00
neuecc
344ae0738c docs: update TOC 2020-06-11 08:44:42 +00:00
neuecc
1b553f67b0 compare table 2020-06-11 17:44:22 +09:00
neuecc
bf0adad427 test for IL2CPP bug 2020-06-11 17:10:29 +09:00
neuecc
11ca42a527 Merge remote-tracking branch 'origin/master' 2020-06-11 16:43:11 +09:00
neuecc
4898e4c7bf Add (I/ReadOnly)AsyncReactiveProperty.WaitAsync 2020-06-11 16:42:59 +09:00
Yoshifumi Kawai
d494e0b9e3 Merge pull request #88 from guitarrapc/master
chore: stop run build-unity via fork PR
2020-06-11 14:35:12 +09:00
Ikiru Yoshizaki
be26ab249b chore: strict filter 2020-06-10 18:17:53 +09:00
Ikiru Yoshizaki
611d8d5513 chore: filter build-unity to be run on Cysharp only 2020-06-10 18:06:50 +09:00
Yoshifumi Kawai
95c93b7c3d Merge pull request #87 from guitarrapc/master
feat: Android il2cpp support
2020-06-10 17:07:56 +09:00
Ikiru Yoshizaki
1dd0c49eec faet: android il2cpp 2020-06-10 13:06:45 +09:00
neuecc
5d8e0e61ad workaround for IL2CPP bug, back to zero allocation 2020-06-10 11:36:58 +09:00
neuecc
478126e256 v 2020-06-09 15:06:34 +09:00
neuecc
80704e489d Merge branch 'fix-il2cpp' 2020-06-09 14:52:23 +09:00
neuecc
3c0aa03643 if def 2020-06-09 14:52:04 +09:00
neuecc
37cd00d347 2.0.15? 2020-06-09 12:16:28 +09:00
neuecc
859c4d706f logging 2020-06-09 12:00:12 +09:00
neuecc
7289fe6e25 ToCoroutine throws exception when error detected 2020-06-09 11:26:03 +09:00
neuecc
0c33977f5a timer and delay skip current frame 2020-06-09 11:25:45 +09:00
neuecc
4d4466e801 Add UniTask.WaitForFixedUpdate 2020-06-08 02:22:10 +09:00
neuecc
79330d7cdb ReadMe 2020-06-08 01:50:20 +09:00
neuecc
680ce1098b ReadMe 2020-06-08 01:45:57 +09:00
neuecc
2337d705ec WithCancellation uses native timing of asyncOperation 2020-06-08 01:45:41 +09:00
neuecc
d2880a818f Add UniTask.NextFrame, UniTask.WaitForEndOfFrame 2020-06-08 01:44:31 +09:00
neuecc
86ea128bf4 t4gen 2020-06-08 00:30:27 +09:00
neuecc
a66f378622 // for CI 2020-06-07 00:27:33 +09:00
neuecc
265f88584b store application.datapath on initialize #86 2020-06-06 14:21:31 +09:00
neuecc
686394c861 2.0.14 pkg version 2020-06-05 17:16:34 +09:00
neuecc
8bad158ab4 fix ci 2020-06-05 17:05:36 +09:00
neuecc
5e59e7ec86 netstandard2.0 support #84 2020-06-05 16:45:40 +09:00
neuecc
8bb0a48720 workaround for struct enumerator await 2020-06-05 15:08:13 +09:00
neuecc
b4468b4eba improve DOTween Extensions 2020-06-05 12:32:16 +09:00
neuecc
0725bd1b30 Merge remote-tracking branch 'origin/master' 2020-06-05 00:44:16 +09:00
neuecc
ebd80243e0 Fix UniTask.ReturnToCurrentSynchronizationContext 2020-06-05 00:43:54 +09:00
neuecc
f1ac469058 Fix UniTask.Defer 2020-06-05 00:43:03 +09:00
neuecc
2e0b603d25 docs: update TOC 2020-06-04 08:54:24 +00:00
neuecc
1d90a40f66 more ReadMe 2020-06-04 17:53:57 +09:00
Mayuki Sawatari
1bec3f507e Merge pull request #75 from Cysharp/feature/docs
Generate and publish documentation to GitHub Pages
2020-06-04 16:16:03 +09:00
Mayuki Sawatari
1d5ecbb3ab Include sub-directory source codes 2020-06-04 15:46:21 +09:00
Mayuki Sawatari
e1a4aeb9da Update toc.yml 2020-06-04 15:46:21 +09:00
Mayuki Sawatari
43f1bb4d85 Generate and publish documentation to GitHub Pages 2020-06-04 15:46:21 +09:00
Yoshifumi Kawai
8b7a0e9b15 Update README.md 2020-06-04 15:31:42 +09:00
neuecc
da329e19d1 CI more 2020-06-04 15:24:09 +09:00
Yoshifumi Kawai
b8260d4e91 Merge pull request #61 from Cysharp/unitask2
UniTask2
2020-06-04 15:17:19 +09:00
neuecc
345e32aaf0 CI again 2020-06-04 15:14:40 +09:00
neuecc
d7bef8c5b5 setup release 2020-06-04 15:11:51 +09:00
neuecc
b2f82df4d3 fix action 2020-06-04 14:58:11 +09:00
neuecc
83596b3d1f docs: update TOC 2020-06-04 05:53:07 +00:00
neuecc
0022598a1c readme 2020-06-04 14:52:42 +09:00
neuecc
f4294d3752 Task Pool moved from Internal 2020-06-04 14:52:36 +09:00
neuecc
a1444c0b39 refactor DistinctUntilChanged 2020-06-03 02:03:31 +09:00
neuecc
e1d5359d73 refactor Where 2020-06-03 01:18:39 +09:00
neuecc
239bf749b6 refactor UniTaskAsyncEnumerable.Select 2020-06-03 00:50:39 +09:00
neuecc
2bf3b1e172 pj 2020-06-02 23:27:42 +09:00
neuecc
d225de201f gitignore 2020-06-02 23:00:47 +09:00
neuecc
c3b8a3852d UniTask.Linq.asmdef 2020-06-02 23:00:20 +09:00
neuecc
c31dab888e fix UnITaskTracker causes Stackoverflow 2020-06-02 22:49:40 +09:00
neuecc
d4cf59bd2f CI 2020-06-01 14:50:25 +09:00
neuecc
d5edc3acd3 guard for trigger invalid ops 2020-06-01 13:51:37 +09:00
neuecc
130286e8c2 TriggerEvent becomes linkedlist 2020-06-01 13:40:35 +09:00
neuecc
a9baa52309 Add ReturnToMainThread, ReturnToSynchronizationContext, ReturnToCurrentSynchronizationContext 2020-05-31 04:30:03 +09:00
neuecc
3001996298 Q check 2020-05-31 04:28:05 +09:00
neuecc
bfcd18aabb MoveNextRunner -> StateMachineRunner 2020-05-29 14:35:50 +09:00
neuecc
96aa299e7e support version -> unity 2018.4 2020-05-29 14:25:26 +09:00
neuecc
24faa34418 TaskPoolMonitor -> TaskPool 2020-05-29 03:58:22 +09:00
neuecc
21bf08a6b3 replace all promisepool to new taskpool system 2020-05-29 03:43:18 +09:00
neuecc
d5db96b913 rename StackNode to TaskPool 2020-05-29 02:08:11 +09:00
neuecc
a8455af16d Improve pooling mechanism 2020-05-29 01:22:46 +09:00
neuecc
2290b14532 reduce AsyncBuilder heap allocation 2020-05-28 22:20:06 +09:00
neuecc
90c5a6311b check il2cpp generics limitation 2020-05-28 21:18:35 +09:00
neuecc
6e0ad3623b non public 2020-05-27 09:16:46 +09:00
neuecc
005e02a1fa sealed 2020-05-27 07:39:19 +09:00
neuecc
10fb8060fa use PooledDelegate to avoid convert Action to Action<AsyncOperation> allocation 2020-05-27 07:37:16 +09:00
neuecc
35b933730b 2.0.11-rc8 2020-05-25 19:44:57 +09:00
neuecc
7ab9467069 IObservable<T>.ToUniTask parameter order changed from CancellationToken cancellationToken, bool useFirst to bool useFirst, CancellationToken cancellationToken 2020-05-25 19:42:51 +09:00
neuecc
598312ba61 DOTween's WithCancellation remove = default 2020-05-25 19:38:08 +09:00
neuecc
985aa5c43a add allocationchecker in netcore sandbox project 2020-05-25 19:37:11 +09:00
neuecc
10eff95a42 fix: does not work zero-allocation mechanism in release build 2020-05-25 19:36:39 +09:00
neuecc
d27d6d5d9d UniTask.Yield in .NET Core becomes zero allocation 2020-05-25 19:33:54 +09:00
neuecc
b8c109848e UniTaskVoid can not await. 2020-05-25 19:33:11 +09:00
neuecc
8b7f832c0f JobHandle.WaitAsync accepts CancellationToken 2020-05-25 09:58:06 +09:00
neuecc
7cce0f48e5 call webRequest.Abort() on canceled 2020-05-25 09:54:26 +09:00
neuecc
8a56838111 modify cannot await twice message 2020-05-25 01:55:35 +09:00
neuecc
ff15e00003 f 2020-05-24 03:33:25 +09:00
neuecc
f60d2c51fb fix in UnityEditor performance issue 2020-05-24 03:27:05 +09:00
neuecc
6dfb969015 Add ValueTask.AsUniTask only for .NET Core 2020-05-24 01:30:52 +09:00
neuecc
da7e9fc4b3 UniTask marked StructLayout(LayoutKind.Auto) 2020-05-24 01:30:33 +09:00
neuecc
70385c4115 Fix channel's cancellationTokenRegistration does not handle correctly 2020-05-24 00:19:13 +09:00
neuecc
51ba740413 In .NET Core, IUniTaskSource implements IValueTaskSource and implicit, zero overhead conversion 2020-05-24 00:18:39 +09:00
neuecc
f3e3ba8864 fix DOTweenExt's TweenCancelBehaviour.CancelAwait 2020-05-23 02:53:48 +09:00
neuecc
07cf65c1ec lower support is 2019.1 2020-05-23 02:12:19 +09:00
neuecc
eca5b1c096 2.0.10-rc7 2020-05-23 02:11:00 +09:00
neuecc
c74ce14ad1 DoTween -> DOTween 2020-05-23 02:10:18 +09:00
neuecc
f59c56506f Remove ConfigureAwait method from all async object extensions(renamed to ToUniTask). Add WithCancellation method to all async object extensions. Improved performance when async object is done. 2020-05-23 02:07:46 +09:00
neuecc
896eef1ee4 Add DoTween Extension 2020-05-23 01:10:04 +09:00
neuecc
ec0123eec7 rename UniTask.VoidAction -> UniTask.Action, UniTask.VoidUnityAction -> UniTask.UnityAction, there return type Func<UniTask> -> Func<UniTaskVoid> 2020-05-22 21:42:23 +09:00
neuecc
78f56b9b33 OCS 2020-05-22 17:15:36 +09:00
neuecc
1d88ed85bc fix ComibineLatest 2020-05-22 11:08:03 +09:00
neuecc
2b7986da19 2.0.9-rc6 2020-05-22 10:45:16 +09:00
neuecc
c3d22968e1 State rename to AsyncReadOnlyReactiveProperty and removed setter and implicit conversion. 2020-05-22 10:44:41 +09:00
neuecc
0e25122ee2 Add Pairwise 2020-05-22 03:19:54 +09:00
neuecc
4504d84aa8 cl2 2020-05-22 02:34:04 +09:00
neuecc
2b87cadba3 Add CombineLatest 2020-05-22 02:25:36 +09:00
neuecc
21dc83c641 2.0.8-rc5 2020-05-21 02:26:55 +09:00
neuecc
3b593f349c Add UnityEvent<T> and InputField AsyncEventHandler and extensions 2020-05-21 02:26:09 +09:00
neuecc
962c215e3b Fix UniTask.WaitUntilValueChanged does not handle UnityEngine.Object is destroyed correctly 2020-05-21 02:24:12 +09:00
neuecc
42dcfdbcdc Add UniTaskAsyncEnumerable.EveryValueChanged 2020-05-21 02:23:40 +09:00
neuecc
6d7e6ec871 Impl AsyncReactiveProperty.ToString, Add State 2020-05-21 02:22:24 +09:00
neuecc
36d53a3bcb rc4 2020-05-20 11:05:58 +09:00
neuecc
ea9e61c2e1 Add CancellationToken.WaitUntilCanceled 2020-05-20 11:04:59 +09:00
neuecc
a52c26102b guard for ForEachAsync 2020-05-20 10:48:28 +09:00
neuecc
e31c87b8a8 Add IUniTaskAsyncEnumerable.Publish 2020-05-19 15:58:04 +09:00
neuecc
cc165a6897 2.0.6-rc3 2020-05-19 04:14:23 +09:00
neuecc
f99910d802 Add TaskTracker to AsyncLINQ 2020-05-19 04:13:46 +09:00
neuecc
997b0b3710 Merge remote-tracking branch 'origin/unitask2' into unitask2 2020-05-19 03:43:09 +09:00
neuecc
ec7064083a Add TaskTracker to Channel 2020-05-19 03:43:06 +09:00
neuecc
07cccfddd6 docs: update TOC 2020-05-18 18:34:05 +00:00
neuecc
f07527cd06 ECS? 2020-05-19 03:33:44 +09:00
neuecc
7b273c4bd1 Add UniTask.Defer 2020-05-19 03:10:37 +09:00
neuecc
d36e7987b3 Add SkipUntilCanceled, TakeUntilCanceled 2020-05-19 02:41:45 +09:00
neuecc
bbd5686816 Add UniTask.WaitUntilCanceled 2020-05-19 01:35:16 +09:00
neuecc
fb1152d8f4 IAsyncReadOnlyReactiveProperty -> IReadOnlyAsyncReactiveProperty, .Dipose retrurns MoveNext -> false 2020-05-19 01:20:20 +09:00
neuecc
7a306118f5 AsyncTrigger returns MoveNext -> false when destroyed 2020-05-19 01:19:46 +09:00
neuecc
efaf3ee8f5 IAsyncReadOnlyReactiveProperty.WithoutCurrent 2020-05-18 23:36:26 +09:00
neuecc
2e4fe90956 Fix ChannelReader.Completion throws UnobservedException when not touched 2020-05-18 23:33:13 +09:00
neuecc
e33d572104 2.0.5-rc2 2020-05-18 11:33:24 +09:00
neuecc
2b2af9e455 meta 2020-05-18 11:31:23 +09:00
neuecc
d003597662 Changed AsyncReactiveProperty produce current value at first, Add AsyncReactiveProperty.WithoutCurrent 2020-05-18 11:30:49 +09:00
neuecc
ec0a8f5a8b Add IUniTaskAsyncEnumerable.Queue 2020-05-18 11:30:04 +09:00
neuecc
49ba57f20a Fix IUniTaskAsyncEnumerable.Take 2020-05-18 11:29:35 +09:00
neuecc
6f4d1183cc Add BindTo<TSource, TObject>(Action<TObject, TSource> bindAction) 2020-05-18 02:35:13 +09:00
neuecc
dd18c9fff8 Add Channel.CreateSingleConsumerUnbounded 2020-05-18 02:34:29 +09:00
neuecc
21f5f78ff1 Merge remote-tracking branch 'origin/unitask2' into unitask2 2020-05-17 16:51:20 +09:00
neuecc
1729f389db fix ReactiveProperty implements IAsyncReactiveProperty 2020-05-17 16:51:10 +09:00
neuecc
6d37bb7bac docs: update TOC 2020-05-17 07:50:05 +00:00
neuecc
957adfad7a fix Await UniTaskAsyncEnumerable.Timer is not over. #76 2020-05-17 16:49:44 +09:00
neuecc
3ef889e17d no artifact name? 2020-05-17 03:02:55 +09:00
neuecc
c73af7390f removed manifestjson 2020-05-17 02:51:51 +09:00
neuecc
c5b4376486 gh-actions 2020-05-17 02:43:54 +09:00
neuecc
ba65049dd8 2.0.4-rc1 2020-05-17 01:39:56 +09:00
neuecc
ee58aab0a9 Add AsyncReactiveProperty 2020-05-17 01:29:45 +09:00
neuecc
859eaa2278 reduce AsyncTrigger allocation 2020-05-16 23:31:49 +09:00
neuecc
79f770e687 Improve Stacktrace Part2 2020-05-13 11:36:33 +09:00
neuecc
8ff4de67a1 improving stacktrace 2020-05-13 05:49:48 +09:00
neuecc
6a7a6fde5c changed AsyncEnumerable.Timer reset timing 2020-05-12 16:32:10 +09:00
neuecc
6a5e259006 fix 2020-05-12 16:09:34 +09:00
neuecc
f6622ad29c StartAsyncCoroutine returns UniTask 2020-05-12 15:55:06 +09:00
neuecc
3de29a181d fixed project structure 2020-05-12 15:44:53 +09:00
neuecc
090cacece5 Add EveryUpdate, Time, Interval, TimerFrame, IntervalFrame 2020-05-12 15:36:42 +09:00
neuecc
354fd65d58 redesigned asyncenumerable ugui and monobehaviourmessagetrigger 2020-05-12 14:29:21 +09:00
neuecc
d3538bdc8f TriggerAsyncEnumerable 2020-05-12 13:15:26 +09:00
neuecc
bd6906792d UnityAsyncEventHandler as IUniTaskAsyncEnumerable 2020-05-12 11:51:50 +09:00
Yoshifumi Kawai
7fc6c6bd36 Merge pull request #73 from Cysharp/async-enumerable
UniTask LINQ
2020-05-12 03:49:01 +09:00
neuecc
c23b9ca480 move to underunity 2020-05-12 03:48:32 +09:00
neuecc
cda59ba9c2 Do 2020-05-12 03:41:53 +09:00
neuecc
61a3744fdd Buffer 2020-05-12 03:33:11 +09:00
neuecc
72efadd0a2 DistinctUntilChanged 2020-05-12 03:01:05 +09:00
neuecc
57c414a6e0 DistinctSelector 2020-05-12 02:45:12 +09:00
neuecc
85dc70a3ab OrderBy 2020-05-12 02:21:06 +09:00
neuecc
7298686d5a Join, GroupBy, GroupJoin 2020-05-12 00:38:06 +09:00
neuecc
418586fbfb GroupBy 2020-05-11 23:17:33 +09:00
neuecc
12c507574e Join 2020-05-11 17:33:41 +09:00
neuecc
b20b37e7a5 Distinct, Except, Intersect, Union 2020-05-11 15:53:27 +09:00
neuecc
8ef7a66081 TakeLast 2020-05-11 14:01:23 +09:00
neuecc
a5f47d4095 SkipLast 2020-05-11 12:38:32 +09:00
neuecc
1316328766 Skip, Take, TakeWhile, SkipWhile 2020-05-11 12:02:02 +09:00
neuecc
c0da316cb4 zip 2020-05-11 02:29:23 +09:00
neuecc
4d13523df7 SelectMany 2020-05-11 02:01:49 +09:00
neuecc
16c527fa89 try selectmany 2020-05-11 00:27:57 +09:00
neuecc
5db5beab29 Reverse 2020-05-10 23:26:25 +09:00
neuecc
3f082f1923 defaultifempty 2020-05-10 22:52:12 +09:00
neuecc
93dd82e3d4 exception testing 2020-05-10 22:44:40 +09:00
neuecc
af6dbd8868 append prepend concat 2020-05-10 03:50:29 +09:00
neuecc
716decd199 ToDict, ToLookup, ToList, TOHashSet, ToObservable 2020-05-10 02:39:13 +09:00
neuecc
f37cd703a9 Aggregate and ForEach 2020-05-10 00:33:46 +09:00
neuecc
31b788a2c9 All, ANy, Contains, SequeuceEqual 2020-05-10 00:07:51 +09:00
neuecc
e93bcbf564 Count, LongCount 2020-05-09 23:33:27 +09:00
neuecc
aa8cb80866 First, Last, Single, ElementAt 2020-05-09 23:22:51 +09:00
neuecc
dd6a8da96f generics MinMax and tests 2020-05-09 22:06:51 +09:00
neuecc
d4511c0f67 Average, MinMax, and others 2020-05-09 15:33:46 +09:00
neuecc
c16433e0fe Never 2020-05-08 15:16:43 +09:00
neuecc
ed0990e402 generator and tests 2020-05-08 12:08:15 +09:00
neuecc
856a049dd0 WithCancellation 2020-05-08 03:48:46 +09:00
neuecc
61b798b6e9 start to implements async linq 2020-05-08 03:23:14 +09:00
neuecc
be45066773 add 2020-05-07 15:17:29 +09:00
neuecc
5d0d29dffd preview3 2020-05-07 11:28:14 +09:00
neuecc
be539fdb10 fix WhenAll,WhenAny 0-length 2020-05-07 11:27:27 +09:00
neuecc
66fa203f7c improv package exporter 2020-05-07 07:38:41 +09:00
neuecc
a78dc55875 preview2 2020-05-07 07:29:31 +09:00
neuecc
84f4d8007d implicit operator UniTask<T> -> UniTask 2020-05-07 07:28:35 +09:00
neuecc
6be955816b Improve AsyncTrigger performance 2020-05-07 07:18:51 +09:00
neuecc
ebe3065c34 delete unitypackage 2020-05-06 03:38:03 +09:00
neuecc
5f90807cb7 + 2020-05-06 02:54:52 +09:00
neuecc
81d83c17c3 Merge branch 'master' into unitask2 2020-05-06 02:51:46 +09:00
neuecc
4e9d268d1c d 2020-05-06 02:50:30 +09:00
neuecc
6c1b590fd8 export 2020-05-06 02:48:29 +09:00
neuecc
32a4e84513 def 2020-05-06 01:17:37 +09:00
neuecc
7f61f85bc7 Addressable support 2020-05-06 00:51:21 +09:00
neuecc
f0d745924a exception choice 2020-05-05 22:51:19 +09:00
neuecc
51f4003bc5 ObjectIdForDebugger 2020-05-05 21:34:11 +09:00
neuecc
b9b2925e8d DotNetCore Version 2020-05-05 21:05:32 +09:00
neuecc
7cb0b17e6a move root to src/UniTask 2020-05-05 20:04:00 +09:00
neuecc
d565f39dde renaming namspeac to Cysharp.Threading.Tasks and move to under Plugins/UniTask 2020-05-05 19:46:43 +09:00
neuecc
a26a806b0f test all passed 2020-05-05 18:12:52 +09:00
neuecc
eb379903b8 some fix 2020-05-05 05:29:52 +09:00
neuecc
6e80295ec7 add PlayerLoopTiming.Last*** 2020-05-05 05:22:49 +09:00
neuecc
75f0bd26e7 ToAsyncLazy 2020-05-05 04:17:08 +09:00
neuecc
b8d1a09224 complete implementation(triggers and etc...) 2020-05-05 04:08:53 +09:00
neuecc
7bc9ef90f1 complete except trigger 2020-05-04 01:59:22 +09:00
neuecc
28e1fa98c9 1.3.1 2020-04-26 21:50:29 +09:00
neuecc
9f7b897837 Add ObjectIdForDebugger to allow IDE stepin debug, #66, #41 2020-04-26 21:49:07 +09:00
neuecc
f28743f7f6 more working 2020-04-26 02:38:16 +09:00
Yoshifumi Kawai
341953b441 Merge pull request #65 from vc-kusuha/fix_Timeout
Fix timeoutTask continues to remain.
2020-04-24 14:57:05 +09:00
くすは
623936c7b8 Fix timeoutTask continues to remain. 2020-04-24 12:32:58 +09:00
neuecc
3654a9e2f9 WhenAll and WhenAny 2020-04-21 13:36:23 +09:00
Yoshifumi Kawai
082f3e7335 more more 2020-04-20 08:35:06 +09:00
Yoshifumi Kawai
fbec6e9a58 check playerloop 2020-04-19 03:38:30 +09:00
Yoshifumi Kawai
ef248e2e0a remove legacy UniTask(occurs many compile error) 2020-04-19 03:24:53 +09:00
Yoshifumi Kawai
86fa934510 diagnosticsext move to internal 2020-04-19 03:00:47 +09:00
Yoshifumi Kawai
ca58784c4d complete delay and factory 2020-04-19 02:55:44 +09:00
Yoshifumi Kawai
11bc28b33f Update config.yml 2020-04-18 22:17:20 +09:00
Yoshifumi Kawai
b2d3423a33 T | IUniTaskSource 2020-04-18 22:11:40 +09:00
Yoshifumi Kawai
2ccaf0a03b complete infrastructure 2020-04-18 05:07:59 +09:00
Yoshifumi Kawai
b4ec35aadd Update config.yml 2020-04-17 11:31:27 +09:00
Yoshifumi Kawai
6c64205292 add readme 2020-04-17 11:15:48 +09:00
Yoshifumi Kawai
232e2eb1f2 add readme 2020-04-17 11:15:15 +09:00
Yoshifumi Kawai
34b065520f add managed dlls 2020-04-16 21:36:22 +09:00
Yoshifumi Kawai
e6734478c5 r 2020-04-16 21:08:56 +09:00
631 changed files with 85519 additions and 15698 deletions

View File

@@ -1,120 +0,0 @@
version: 2.1
executors:
unity:
# https://hub.docker.com/r/gableroux/unity3d/tags
parameters:
version: {type: string}
docker:
- image: gableroux/unity3d:<< parameters.version >>
go:
docker:
- image: circleci/golang
commands:
unity_activate:
parameters:
unity_version: {type: string}
unity_license: {type: string}
steps:
# get activation file, if fail to activate unity, use this key and activate from https://license.unity3d.com/manual
- run: apt update && apt install libunwind8 -y
- run: /opt/Unity/Editor/Unity -quit -batchmode -nographics -logFile -createManualActivationFile || exit 0
- run: cat Unity_v<< parameters.unity_version >>.alf
# get from UNITY_LICENSE envvar(base64 encoded(cat foo.ulf | base64 )), this file is generated from above manual activation
- run: echo << parameters.unity_license >> | base64 -di >> .circleci/Unity.ulf
- run: /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -manualLicenseFile .circleci/Unity.ulf || exit 0
jobs:
build-and-test:
parameters:
unity_version: {type: string}
unity_license: {type: string}
executor:
name: unity
version: << parameters.unity_version >>
steps:
- checkout
- unity_activate:
unity_version: << parameters.unity_version >>
unity_license: << parameters.unity_license >>
- run:
name: Build Linux(Mono)
command: /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend Mono2x /BuildTarget StandaloneLinux64
working_directory: .
# TODO:check unity version and packages...
# - run: ./bin/UnitTest/StandaloneLinux64_Mono2x/test
build-and-create-package:
parameters:
unity_version: {type: string}
unity_license: {type: string}
executor:
name: unity
version: << parameters.unity_version >>
steps:
- checkout
- unity_activate:
unity_version: << parameters.unity_version >>
unity_license: << parameters.unity_license >>
- run:
name: Export unitypackage
command: /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
working_directory: .
- store_artifacts:
path: ./UniRx.Async.unitypackage
destination: /UniRx.Async.unitypackage
# upload to github by ghr
upload-github:
executor: go
steps:
- attach_workspace:
at: .
- run: go get github.com/tcnksm/ghr
- run: ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_TAG} .
- store_artifacts:
path: UniRx.Async.unitypackage
destination: UniRx.Async.unitypackage
workflows:
version: 2
build-unity:
jobs:
# does not exists yet.
# - build-and-test:
# unity_version: 2019.3.0a2
# unity_license: ${UNITY_LICENSE_2019_3}
# - build-and-test:
# unity_version: 2019.2.0b2
# unity_license: ${UNITY_LICENSE_2019_2}
- build-and-create-package:
unity_version: 2019.1.2f1
unity_license: ${UNITY_LICENSE_2019_1}
filters:
tags:
only: /.*/
- build-and-test:
unity_version: 2019.1.2f1
unity_license: ${UNITY_LICENSE_2019_1}
filters:
tags:
only: /.*/
# test asmdef will not found.
# - build-and-test:
# unity_version: 2018.4.0f1
# unity_license: ${UNITY_LICENSE_2018_4}
# # UniTask minimum support version is 2018.3(C# 7.x)
# - build-and-test:
# unity_version: 2018.3.12f1
# unity_license: ${UNITY_LICENSE_2018_3}
- build-and-create-package-release:
unity_version: 2019.1.2f1
unity_license: ${UNITY_LICENSE_2019_1}
filters:
tags:
only: /^\d\.\d\.\d.*/
branches:
ignore: /.*/
- upload-github:
requires:
- build-and-create-package-release
filters:
tags:
only: /^\d\.\d\.\d.*/
branches:
ignore: /.*/

13
.config/dotnet-tools.json Normal file
View File

@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"docfx": {
"version": "2.78.3",
"commands": [
"docfx"
],
"rollForward": false
}
}
}

41
.editorconfig Normal file
View File

@@ -0,0 +1,41 @@
# top-most EditorConfig file
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
# Visual Studio Spell checker configs (https://learn.microsoft.com/en-us/visualstudio/ide/text-spell-checker?view=vs-2022#how-to-customize-the-spell-checker)
spelling_exclusion_path = ./exclusion.dic
[*.cs]
indent_size = 4
charset = utf-8-bom
end_of_line = unset
# Solution files
[*.{sln,slnx}]
end_of_line = unset
# MSBuild project files
[*.{csproj,props,targets}]
end_of_line = unset
# Xml config files
[*.{ruleset,config,nuspec,resx,runsettings,DotSettings}]
end_of_line = unset
[*{_AssemblyInfo.cs,.notsupported.cs}]
generated_code = true
# C# code style settings
[*.{cs}]
dotnet_diagnostic.IDE0044.severity = none # IDE0044: Make field readonly
# https://stackoverflow.com/questions/79195382/how-to-disable-fading-unused-methods-in-visual-studio-2022-17-12-0
dotnet_diagnostic.IDE0051.severity = none # IDE0051: Remove unused private member
dotnet_diagnostic.IDE0130.severity = none # IDE0130: Namespace does not match folder structure

1
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1 @@
github: [neuecc]

18
.github/dependabot.yaml vendored Normal file
View File

@@ -0,0 +1,18 @@
# ref: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly" # Check for updates to GitHub Actions every week
groups:
dependencies:
patterns:
- "*"
cooldown:
default-days: 14 # Wait 14 days before creating another PR for the same dependency. This will prevent vulnerability on the package impact.
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

93
.github/workflows/build-debug.yaml vendored Normal file
View File

@@ -0,0 +1,93 @@
name: Build-Debug
on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
jobs:
build-dotnet:
permissions:
contents: read
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: Cysharp/Actions/.github/actions/checkout@main
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
- run: dotnet build -c Release
- run: dotnet test -c Release
- run: dotnet pack -c Release --no-build -p:IncludeSymbols=true -o $GITHUB_WORKSPACE/artifacts
build-unity:
if: ${{ ((github.event_name == 'push' && github.repository_owner == 'Cysharp') || startsWith(github.event.pull_request.head.label, 'Cysharp:')) && github.triggering_actor != 'dependabot[bot]' }}
strategy:
fail-fast: false
max-parallel: 2
matrix:
unity: ["2022.3.39f1", "6000.0.12f1"] # Test with LTS
permissions:
contents: read
runs-on: ubuntu-24.04
timeout-minutes: 30 # Unity build takes more than 20min.
steps:
- name: Load secrets
id: op-load-secret
uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0 # v2.0.0
with:
export-env: false
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_PUBLIC }}
UNITY_EMAIL: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/username"
UNITY_PASSWORD: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/credential"
UNITY_SERIAL: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/serial"
- uses: Cysharp/Actions/.github/actions/checkout@main
# Execute scripts: Export Package
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
- name: Build Unity (.unitypacakge)
if: ${{ startsWith(matrix.unity, '2022') }} # only execute once
uses: Cysharp/Actions/.github/actions/unity-builder@main
env:
UNITY_EMAIL: ${{ steps.op-load-secret.outputs.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ steps.op-load-secret.outputs.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ steps.op-load-secret.outputs.UNITY_SERIAL }}
with:
projectPath: src/UniTask
unityVersion: ${{ matrix.unity }}
targetPlatform: StandaloneLinux64
buildMethod: PackageExporter.Export
# Execute UnitTest
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend IL2CPP /BuildTarget StandaloneLinux64
- name: Build UnitTest (IL2CPP)
uses: Cysharp/Actions/.github/actions/unity-builder@main
env:
UNITY_EMAIL: ${{ steps.op-load-secret.outputs.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ steps.op-load-secret.outputs.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ steps.op-load-secret.outputs.UNITY_SERIAL }}
with:
projectPath: src/UniTask
unityVersion: ${{ matrix.unity }}
targetPlatform: StandaloneLinux64
buildMethod: UnitTestBuilder.BuildUnitTest
customParameters: "/headless /ScriptBackend IL2CPP"
- name: Check UnitTest file is generated
run: ls -lR ./src/UniTask/bin/UnitTest
- name: Execute UnitTest
run: ./src/UniTask/bin/UnitTest/StandaloneLinux64_IL2CPP/test
- uses: Cysharp/Actions/.github/actions/check-metas@main # check meta files
with:
directory: src/UniTask
# Store artifacts.
- uses: Cysharp/Actions/.github/actions/upload-artifact@main
if: ${{ startsWith(matrix.unity, '2021') }} # only execute 2021
with:
name: UniTask.unitypackage-${{ matrix.unity }}.zip
path: ./src/UniTask/*.unitypackage
retention-days: 1

58
.github/workflows/build-docs.yaml vendored Normal file
View File

@@ -0,0 +1,58 @@
name: build-docs
on:
push:
branches:
- master
- feature/docs
jobs:
run-docfx:
if: ${{ ((github.event_name == 'push' && github.repository_owner == 'Cysharp') || startsWith(github.event.pull_request.head.label, 'Cysharp:')) && github.triggering_actor != 'dependabot[bot]' }}
permissions:
contents: write
pages: write
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Load secrets
id: op-load-secret
uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0 # v2.0.0
with:
export-env: false
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_PUBLIC }}
UNITY_EMAIL: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/username"
UNITY_PASSWORD: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/credential"
UNITY_SERIAL: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/serial"
- uses: Cysharp/Actions/.github/actions/checkout@main
# Execute scripts: Export Package
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
- name: Build Unity (.unitypackage)
uses: Cysharp/Actions/.github/actions/unity-builder@main
env:
UNITY_EMAIL: ${{ steps.op-load-secret.outputs.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ steps.op-load-secret.outputs.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ steps.op-load-secret.outputs.UNITY_SERIAL }}
with:
projectPath: src/UniTask
unityVersion: "2022.3.39f1"
targetPlatform: StandaloneLinux64
buildMethod: PackageExporter.Export
- uses: Cysharp/Actions/.github/actions/checkout@main
with:
repository: Cysharp/DocfxTemplate
path: docs/_DocfxTemplate
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
- name: dotnet tool restore
run: dotnet tool restore
- name: Docfx metadata
run: dotnet docfx metadata docs/docfx.json
- name: Docfx build
run: dotnet docfx build docs/docfx.json
- name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site

122
.github/workflows/build-release.yaml vendored Normal file
View File

@@ -0,0 +1,122 @@
name: build-release
on:
workflow_dispatch:
inputs:
tag:
description: "tag: git tag you want create. (sample 1.0.0)"
required: true
dry-run:
description: "dry-run: true will never create relase/nuget."
required: true
default: false
type: boolean
jobs:
update-packagejson:
permissions:
actions: read
contents: write
uses: Cysharp/Actions/.github/workflows/update-packagejson.yaml@main
with:
file-path: ./src/UniTask/Assets/Plugins/UniTask/package.json
tag: ${{ inputs.tag }}
dry-run: ${{ inputs.dry-run }}
build-dotnet:
needs: [update-packagejson]
permissions:
contents: read
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- run: echo ${{ needs.update-packagejson.outputs.sha }}
- uses: Cysharp/Actions/.github/actions/checkout@main
with:
ref: ${{ needs.update-packagejson.outputs.sha }}
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
# build and pack
- run: dotnet build -c Release -p:Version=${{ inputs.tag }}
- run: dotnet test -c Release --no-build
- run: dotnet pack ./src/UniTask.NetCore/UniTask.NetCore.csproj -c Release --no-build -p:Version=${{ inputs.tag }} -o ./publish
# Store artifacts.
- uses: Cysharp/Actions/.github/actions/upload-artifact@main
with:
name: nuget
path: ./publish/
retention-days: 1
build-unity:
needs: [update-packagejson]
strategy:
matrix:
unity: ["2022.3.39f1"]
permissions:
contents: read
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Load secrets
id: op-load-secret
uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0 # v2.0.0
with:
export-env: false
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_PUBLIC }}
UNITY_EMAIL: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/username"
UNITY_PASSWORD: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/credential"
UNITY_SERIAL: "op://${{ vars.OP_VAULT_ACTIONS_PUBLIC }}/UNITY_LICENSE/serial"
- run: echo ${{ needs.update-packagejson.outputs.sha }}
- uses: Cysharp/Actions/.github/actions/checkout@main
with:
ref: ${{ needs.update-packagejson.outputs.sha }}
# Execute scripts: Export Package
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
- name: Build Unity (.unitypacakge)
uses: Cysharp/Actions/.github/actions/unity-builder@main
env:
UNITY_EMAIL: ${{ steps.op-load-secret.outputs.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ steps.op-load-secret.outputs.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ steps.op-load-secret.outputs.UNITY_SERIAL }}
with:
projectPath: src/UniTask
unityVersion: ${{ matrix.unity }}
targetPlatform: StandaloneLinux64
buildMethod: PackageExporter.Export
- uses: Cysharp/Actions/.github/actions/check-metas@main # check meta files
with:
directory: src/UniTask
# Store artifacts.
- uses: Cysharp/Actions/.github/actions/upload-artifact@main
with:
name: UniTask.${{ inputs.tag }}.unitypackage
path: ./src/UniTask/UniTask.${{ inputs.tag }}.unitypackage
retention-days: 1
# release
create-release:
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 }}
dry-run: ${{ inputs.dry-run }}
tag: ${{ inputs.tag }}
nuget-push: true
release-upload: true
release-asset-path: ./UniTask.${{ inputs.tag }}.unitypackage/UniTask.${{ inputs.tag }}.unitypackage
secrets: inherit
cleanup:
if: ${{ needs.update-packagejson.outputs.is-branch-created == 'true' }}
needs: [update-packagejson, build-dotnet, build-unity]
permissions:
contents: write
uses: Cysharp/Actions/.github/workflows/clean-packagejson-branch.yaml@main
with:
branch: ${{ needs.update-packagejson.outputs.branch-name }}

View File

@@ -0,0 +1,12 @@
name: Prevent github change
on:
pull_request:
paths:
- ".github/**/*.yaml"
- ".github/**/*.yml"
jobs:
detect:
permissions:
contents: read
uses: Cysharp/Actions/.github/workflows/prevent-github-change.yaml@main

14
.github/workflows/stale.yaml vendored Normal file
View File

@@ -0,0 +1,14 @@
name: "Close stale issues"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
stale:
permissions:
contents: read
pull-requests: write
issues: write
uses: Cysharp/Actions/.github/workflows/stale-issue.yaml@main

15
.github/workflows/toc.yaml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: TOC Generator
on:
push:
paths:
- 'README.md'
jobs:
toc:
permissions:
contents: write
uses: Cysharp/Actions/.github/workflows/toc-generator.yaml@main
with:
TOC_TITLE: "## Table of Contents"
secrets: inherit

43
.gitignore vendored
View File

@@ -80,7 +80,7 @@ _ReSharper*
*.ncrunch*
.*crunch*.local.xml
# Installshield output folder
# Installshield output folder
[Ee]xpress
# DocProject is a documentation generator add-in
@@ -100,7 +100,19 @@ publish
*.Publish.xml
# NuGet Packages Directory
packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
# packages # upm pacakge will use Packages
# **/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
# !**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Windows Azure Build Output
csx
@@ -130,20 +142,15 @@ UpgradeLog*.XML
Assets/WSATestCertificate.pfx
.vs/
Assembly-CSharp\.csproj
# Unity
UniRx\.Async\.csproj
UniRx\.Async\.Editor\.csproj
UniRx\.Async\.Tests\.csproj
UniTask\.sln
RuntimeUnitTestToolkit\.csproj
Assembly-CSharp-Editor\.csproj
UniRx\.Async\.unitypackage
UniRx.Async.Tests.Editor.csproj
# Unity
.vsconfig
src/UniTask/Library/*
src/UniTask/Temp/*
src/UniTask/Logs/*
src/UniTask/[Uu]ser[Ss]ettings/
src/UniTask/*.sln
src/UniTask/*.csproj
src/UniTask/*.unitypackage
!src/UniTask/Packages/

View File

@@ -1,35 +0,0 @@
#if UNITY_EDITOR
using System;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
public static class PackageExporter
{
[MenuItem("Tools/Export Unitypackage")]
public static void Export()
{
// configure
var root = "UniRx.Async";
var exportPath = "./UniRx.Async.unitypackage";
var path = Path.Combine(Application.dataPath, root);
var assets = Directory.EnumerateFiles(path, "*", SearchOption.AllDirectories)
.Where(x => Path.GetExtension(x) == ".cs" || Path.GetExtension(x) == ".asmdef" || Path.GetExtension(x) == ".json" || Path.GetExtension(x) == ".meta")
.Select(x => "Assets" + x.Replace(Application.dataPath, "").Replace(@"\", "/"))
.ToArray();
UnityEngine.Debug.Log("Export below files" + Environment.NewLine + string.Join(Environment.NewLine, assets));
AssetDatabase.ExportPackage(
assets,
exportPath,
ExportPackageOptions.Default);
UnityEngine.Debug.Log("Export complete: " + Path.GetFullPath(exportPath));
}
}
#endif

View File

@@ -1,133 +0,0 @@
#if UNITY_EDITOR
using System;
using UnityEngine;
namespace RuntimeUnitTestToolkit.Editor
{
// functional declarative construction like flutter.
internal interface IBuilder
{
GameObject GameObject { get; }
T GetComponent<T>();
}
internal class Builder<T> : IBuilder
where T : Component
{
public T Component1 { get; private set; }
public GameObject GameObject { get; private set; }
public Transform Transform { get { return GameObject.transform; } }
public RectTransform RectTransform { get { return GameObject.GetComponent<RectTransform>(); } }
public Action<GameObject> SetTarget
{
set
{
value(this.GameObject);
}
}
public IBuilder Child
{
set
{
value.GameObject.transform.SetParent(GameObject.transform);
}
}
public IBuilder[] Children
{
set
{
foreach (var item in value)
{
item.GameObject.transform.SetParent(GameObject.transform);
}
}
}
public Builder(string name)
{
this.GameObject = new GameObject(name);
this.Component1 = GameObject.AddComponent<T>();
}
public Builder(string name, out T referenceSelf) // out primary reference.
{
this.GameObject = new GameObject(name);
this.Component1 = GameObject.AddComponent<T>();
referenceSelf = this.Component1;
}
public TComponent GetComponent<TComponent>()
{
return this.GameObject.GetComponent<TComponent>();
}
}
internal class Builder<T1, T2> : Builder<T1>
where T1 : Component
where T2 : Component
{
public T2 Component2 { get; private set; }
public Builder(string name)
: base(name)
{
this.Component2 = GameObject.AddComponent<T2>();
}
public Builder(string name, out T1 referenceSelf)
: base(name, out referenceSelf)
{
this.Component2 = GameObject.AddComponent<T2>();
}
}
internal class Builder<T1, T2, T3> : Builder<T1, T2>
where T1 : Component
where T2 : Component
where T3 : Component
{
public T3 Component3 { get; private set; }
public Builder(string name)
: base(name)
{
this.Component3 = GameObject.AddComponent<T3>();
}
public Builder(string name, out T1 referenceSelf)
: base(name, out referenceSelf)
{
this.Component3 = GameObject.AddComponent<T3>();
}
}
internal class Builder<T1, T2, T3, T4> : Builder<T1, T2, T3>
where T1 : Component
where T2 : Component
where T3 : Component
where T4 : Component
{
public T4 Component4 { get; private set; }
public Builder(string name)
: base(name)
{
this.Component4 = GameObject.AddComponent<T4>();
}
public Builder(string name, out T1 referenceSelf)
: base(name, out referenceSelf)
{
this.Component4 = GameObject.AddComponent<T4>();
}
}
}
#endif

View File

@@ -1,341 +0,0 @@
#if UNITY_EDITOR
using UnityEditor;
// Settings MenuItems.
public static partial class UnitTestBuilder
{
[MenuItem("Test/Settings/ScriptBackend/Mono", validate = true, priority = 1)]
static bool ValidateScriptBackendMono()
{
Menu.SetChecked("Test/Settings/ScriptBackend/Mono", LoadOrGetDefaultSettings().ScriptBackend == ScriptingImplementation.Mono2x);
return true;
}
[MenuItem("Test/Settings/ScriptBackend/Mono", validate = false, priority = 1)]
static void ScriptBackendMono()
{
var settings = LoadOrGetDefaultSettings();
settings.UseCurrentScriptBackend = false;
settings.ScriptBackend = ScriptingImplementation.Mono2x;
SaveSettings(settings);
}
[MenuItem("Test/Settings/ScriptBackend/IL2CPP", validate = true, priority = 2)]
static bool ValidateScriptBackendIL2CPP()
{
Menu.SetChecked("Test/Settings/ScriptBackend/IL2CPP", LoadOrGetDefaultSettings().ScriptBackend == ScriptingImplementation.IL2CPP);
return true;
}
[MenuItem("Test/Settings/ScriptBackend/IL2CPP", validate = false, priority = 2)]
static void ScriptBackendIL2CPP()
{
var settings = LoadOrGetDefaultSettings();
settings.UseCurrentScriptBackend = false;
settings.ScriptBackend = ScriptingImplementation.IL2CPP;
SaveSettings(settings);
}
[MenuItem("Test/Settings/AutoRunPlayer", validate = true, priority = 3)]
static bool ValidateAutoRun()
{
Menu.SetChecked("Test/Settings/AutoRunPlayer", LoadOrGetDefaultSettings().AutoRunPlayer);
return true;
}
[MenuItem("Test/Settings/AutoRunPlayer", validate = false, priority = 3)]
static void AutoRun()
{
var settings = LoadOrGetDefaultSettings();
settings.AutoRunPlayer = !settings.AutoRunPlayer;
SaveSettings(settings);
}
[MenuItem("Test/Settings/Headless", validate = true, priority = 4)]
static bool ValidateHeadless()
{
Menu.SetChecked("Test/Settings/Headless", LoadOrGetDefaultSettings().Headless);
return true;
}
[MenuItem("Test/Settings/Headless", validate = false, priority = 4)]
static void Headless()
{
var settings = LoadOrGetDefaultSettings();
settings.Headless = !settings.Headless;
SaveSettings(settings);
}
[MenuItem("Test/Settings/DisableAutoClose", validate = true, priority = 5)]
static bool ValidateDisableAutoClose()
{
Menu.SetChecked("Test/Settings/DisableAutoClose", LoadOrGetDefaultSettings().DisableAutoClose);
return true;
}
[MenuItem("Test/Settings/DisableAutoClose", validate = false, priority = 5)]
static void DisableAutoClose()
{
var settings = LoadOrGetDefaultSettings();
settings.DisableAutoClose = !settings.DisableAutoClose;
SaveSettings(settings);
}
// generated
/*
*
void Main()
{
var sb = new StringBuilder();
var p = 1;
foreach (var target in Enum.GetNames(typeof(BuildTarget)))
{
var path = $"Test/Settings/BuildTarget/{target}";
var priority = p++;
var template = $@"
[MenuItem(""{path}"", validate = true, priority = {priority})]
static bool ValidateBuildTarget{target}()
{{
Menu.SetChecked(""{path}"", LoadOrGetDefaultSettings().BuildTarget == BuildTarget.{target});
return true;
}}
[MenuItem(""{path}"", validate = false, priority = {priority})]
static void BuildTarget{target}()
{{
var settings = LoadOrGetDefaultSettings();
settings.UseCurrentBuildTarget = false;
settings.BuildTarget = BuildTarget.{target};
SaveSettings(settings);
}}";
sb.AppendLine(template);
}
sb.ToString().Dump();
}
public enum BuildTarget
{
StandaloneWindows,
StandaloneWindows64,
StandaloneLinux,
StandaloneLinux64,
StandaloneOSX,
WebGL,
iOS,
Android,
WSAPlayer,
PS4,
XboxOne,
Switch,
}
*/
[MenuItem("Test/Settings/BuildTarget/StandaloneWindows", validate = true, priority = 1)]
static bool ValidateBuildTargetStandaloneWindows()
{
Menu.SetChecked("Test/Settings/BuildTarget/StandaloneWindows", LoadOrGetDefaultSettings().BuildTarget == BuildTarget.StandaloneWindows);
return true;
}
[MenuItem("Test/Settings/BuildTarget/StandaloneWindows", validate = false, priority = 1)]
static void BuildTargetStandaloneWindows()
{
var settings = LoadOrGetDefaultSettings();
settings.UseCurrentBuildTarget = false;
settings.BuildTarget = BuildTarget.StandaloneWindows;
SaveSettings(settings);
}
[MenuItem("Test/Settings/BuildTarget/StandaloneWindows64", validate = true, priority = 2)]
static bool ValidateBuildTargetStandaloneWindows64()
{
Menu.SetChecked("Test/Settings/BuildTarget/StandaloneWindows64", LoadOrGetDefaultSettings().BuildTarget == BuildTarget.StandaloneWindows64);
return true;
}
[MenuItem("Test/Settings/BuildTarget/StandaloneWindows64", validate = false, priority = 2)]
static void BuildTargetStandaloneWindows64()
{
var settings = LoadOrGetDefaultSettings();
settings.UseCurrentBuildTarget = false;
settings.BuildTarget = BuildTarget.StandaloneWindows64;
SaveSettings(settings);
}
//[MenuItem("Test/Settings/BuildTarget/StandaloneLinux", validate = true, priority = 3)]
//static bool ValidateBuildTargetStandaloneLinux()
//{
// Menu.SetChecked("Test/Settings/BuildTarget/StandaloneLinux", LoadOrGetDefaultSettings().BuildTarget == BuildTarget.StandaloneLinux);
// return true;
//}
//[MenuItem("Test/Settings/BuildTarget/StandaloneLinux", validate = false, priority = 3)]
//static void BuildTargetStandaloneLinux()
//{
// var settings = LoadOrGetDefaultSettings();
// settings.UseCurrentBuildTarget = false;
// settings.BuildTarget = BuildTarget.StandaloneLinux;
// SaveSettings(settings);
//}
[MenuItem("Test/Settings/BuildTarget/StandaloneLinux64", validate = true, priority = 4)]
static bool ValidateBuildTargetStandaloneLinux64()
{
Menu.SetChecked("Test/Settings/BuildTarget/StandaloneLinux64", LoadOrGetDefaultSettings().BuildTarget == BuildTarget.StandaloneLinux64);
return true;
}
[MenuItem("Test/Settings/BuildTarget/StandaloneLinux64", validate = false, priority = 4)]
static void BuildTargetStandaloneLinux64()
{
var settings = LoadOrGetDefaultSettings();
settings.UseCurrentBuildTarget = false;
settings.BuildTarget = BuildTarget.StandaloneLinux64;
SaveSettings(settings);
}
[MenuItem("Test/Settings/BuildTarget/StandaloneOSX", validate = true, priority = 5)]
static bool ValidateBuildTargetStandaloneOSX()
{
Menu.SetChecked("Test/Settings/BuildTarget/StandaloneOSX", LoadOrGetDefaultSettings().BuildTarget == BuildTarget.StandaloneOSX);
return true;
}
[MenuItem("Test/Settings/BuildTarget/StandaloneOSX", validate = false, priority = 5)]
static void BuildTargetStandaloneOSX()
{
var settings = LoadOrGetDefaultSettings();
settings.UseCurrentBuildTarget = false;
settings.BuildTarget = BuildTarget.StandaloneOSX;
SaveSettings(settings);
}
[MenuItem("Test/Settings/BuildTarget/WebGL", validate = true, priority = 6)]
static bool ValidateBuildTargetWebGL()
{
Menu.SetChecked("Test/Settings/BuildTarget/WebGL", LoadOrGetDefaultSettings().BuildTarget == BuildTarget.WebGL);
return true;
}
[MenuItem("Test/Settings/BuildTarget/WebGL", validate = false, priority = 6)]
static void BuildTargetWebGL()
{
var settings = LoadOrGetDefaultSettings();
settings.UseCurrentBuildTarget = false;
settings.BuildTarget = BuildTarget.WebGL;
SaveSettings(settings);
}
[MenuItem("Test/Settings/BuildTarget/iOS", validate = true, priority = 7)]
static bool ValidateBuildTargetiOS()
{
Menu.SetChecked("Test/Settings/BuildTarget/iOS", LoadOrGetDefaultSettings().BuildTarget == BuildTarget.iOS);
return true;
}
[MenuItem("Test/Settings/BuildTarget/iOS", validate = false, priority = 7)]
static void BuildTargetiOS()
{
var settings = LoadOrGetDefaultSettings();
settings.UseCurrentBuildTarget = false;
settings.BuildTarget = BuildTarget.iOS;
SaveSettings(settings);
}
[MenuItem("Test/Settings/BuildTarget/Android", validate = true, priority = 8)]
static bool ValidateBuildTargetAndroid()
{
Menu.SetChecked("Test/Settings/BuildTarget/Android", LoadOrGetDefaultSettings().BuildTarget == BuildTarget.Android);
return true;
}
[MenuItem("Test/Settings/BuildTarget/Android", validate = false, priority = 8)]
static void BuildTargetAndroid()
{
var settings = LoadOrGetDefaultSettings();
settings.UseCurrentBuildTarget = false;
settings.BuildTarget = BuildTarget.Android;
SaveSettings(settings);
}
[MenuItem("Test/Settings/BuildTarget/WSAPlayer", validate = true, priority = 9)]
static bool ValidateBuildTargetWSAPlayer()
{
Menu.SetChecked("Test/Settings/BuildTarget/WSAPlayer", LoadOrGetDefaultSettings().BuildTarget == BuildTarget.WSAPlayer);
return true;
}
[MenuItem("Test/Settings/BuildTarget/WSAPlayer", validate = false, priority = 9)]
static void BuildTargetWSAPlayer()
{
var settings = LoadOrGetDefaultSettings();
settings.UseCurrentBuildTarget = false;
settings.BuildTarget = BuildTarget.WSAPlayer;
SaveSettings(settings);
}
[MenuItem("Test/Settings/BuildTarget/PS4", validate = true, priority = 10)]
static bool ValidateBuildTargetPS4()
{
Menu.SetChecked("Test/Settings/BuildTarget/PS4", LoadOrGetDefaultSettings().BuildTarget == BuildTarget.PS4);
return true;
}
[MenuItem("Test/Settings/BuildTarget/PS4", validate = false, priority = 10)]
static void BuildTargetPS4()
{
var settings = LoadOrGetDefaultSettings();
settings.UseCurrentBuildTarget = false;
settings.BuildTarget = BuildTarget.PS4;
SaveSettings(settings);
}
[MenuItem("Test/Settings/BuildTarget/XboxOne", validate = true, priority = 11)]
static bool ValidateBuildTargetXboxOne()
{
Menu.SetChecked("Test/Settings/BuildTarget/XboxOne", LoadOrGetDefaultSettings().BuildTarget == BuildTarget.XboxOne);
return true;
}
[MenuItem("Test/Settings/BuildTarget/XboxOne", validate = false, priority = 11)]
static void BuildTargetXboxOne()
{
var settings = LoadOrGetDefaultSettings();
settings.UseCurrentBuildTarget = false;
settings.BuildTarget = BuildTarget.XboxOne;
SaveSettings(settings);
}
[MenuItem("Test/Settings/BuildTarget/Switch", validate = true, priority = 12)]
static bool ValidateBuildTargetSwitch()
{
Menu.SetChecked("Test/Settings/BuildTarget/Switch", LoadOrGetDefaultSettings().BuildTarget == BuildTarget.Switch);
return true;
}
[MenuItem("Test/Settings/BuildTarget/Switch", validate = false, priority = 12)]
static void BuildTargetSwitch()
{
var settings = LoadOrGetDefaultSettings();
settings.UseCurrentBuildTarget = false;
settings.BuildTarget = BuildTarget.Switch;
SaveSettings(settings);
}
}
#endif

View File

@@ -1,515 +0,0 @@
#if UNITY_EDITOR
using RuntimeUnitTestToolkit;
using RuntimeUnitTestToolkit.Editor;
using System;
using UnityEditor;
using UnityEditor.Build.Reporting;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
internal class RuntimeUnitTestSettings
{
public ScriptingImplementation ScriptBackend;
public bool UseCurrentScriptBackend;
public BuildTarget BuildTarget;
public bool UseCurrentBuildTarget;
public bool Headless;
public bool AutoRunPlayer;
public bool DisableAutoClose;
public RuntimeUnitTestSettings()
{
UseCurrentBuildTarget = true;
UseCurrentScriptBackend = true;
Headless = false;
AutoRunPlayer = true;
DisableAutoClose = false;
}
public override string ToString()
{
return $"{ScriptBackend} {BuildTarget} Headless:{Headless} AutoRunPlayer:{AutoRunPlayer} DisableAutoClose:{DisableAutoClose}";
}
}
// no namespace(because invoke from commandline)
public static partial class UnitTestBuilder
{
const string SettingsKeyBase = "RuntimeUnitTest.Settings.";
[MenuItem("Test/BuildUnitTest")]
public static void BuildUnitTest()
{
var settings = new RuntimeUnitTestSettings(); // default
string buildPath = null;
if (Application.isBatchMode) // from commandline
{
settings.AutoRunPlayer = false;
settings.DisableAutoClose = false;
var cmdArgs = Environment.GetCommandLineArgs();
for (int i = 0; i < cmdArgs.Length; i++)
{
if (string.Equals(cmdArgs[i].Trim('-', '/'), "ScriptBackend", StringComparison.OrdinalIgnoreCase))
{
settings.UseCurrentScriptBackend = false;
var str = cmdArgs[++i];
if (str.StartsWith("mono", StringComparison.OrdinalIgnoreCase))
{
settings.ScriptBackend = ScriptingImplementation.Mono2x;
}
else if (str.StartsWith("IL2CPP", StringComparison.OrdinalIgnoreCase))
{
settings.ScriptBackend = ScriptingImplementation.IL2CPP;
}
else
{
settings.ScriptBackend = (ScriptingImplementation)Enum.Parse(typeof(ScriptingImplementation), str, true);
}
}
else if (string.Equals(cmdArgs[i].Trim('-', '/'), "BuildTarget", StringComparison.OrdinalIgnoreCase))
{
settings.UseCurrentBuildTarget = false;
settings.BuildTarget = (BuildTarget)Enum.Parse(typeof(BuildTarget), cmdArgs[++i], true);
}
else if (string.Equals(cmdArgs[i].Trim('-', '/'), "Headless", StringComparison.OrdinalIgnoreCase))
{
settings.Headless = true;
}
else if (string.Equals(cmdArgs[i].Trim('-', '/'), "buildPath", StringComparison.OrdinalIgnoreCase))
{
buildPath = cmdArgs[++i];
}
}
}
else
{
var key = SettingsKeyBase + Application.productName;
var settingsValue = EditorPrefs.GetString(key, null);
try
{
if (!string.IsNullOrWhiteSpace(settingsValue))
{
settings = JsonUtility.FromJson<RuntimeUnitTestSettings>(settingsValue);
}
}
catch
{
UnityEngine.Debug.LogError("Fail to load RuntimeUnitTest settings");
EditorPrefs.SetString(key, null);
}
}
if (settings.UseCurrentBuildTarget)
{
settings.BuildTarget = EditorUserBuildSettings.activeBuildTarget;
}
if (settings.UseCurrentScriptBackend)
{
settings.ScriptBackend = PlayerSettings.GetScriptingBackend(ToBuildTargetGroup(settings.BuildTarget));
}
if (buildPath == null)
{
buildPath = $"bin/UnitTest/{settings.BuildTarget}_{settings.ScriptBackend}/test" + (IsWindows(settings.BuildTarget) ? ".exe" : "");
}
var originalScene = SceneManager.GetActiveScene().path;
BuildUnitTest(buildPath, settings.ScriptBackend, settings.BuildTarget, settings.Headless, settings.AutoRunPlayer, settings.DisableAutoClose);
// reopen original scene
if (!string.IsNullOrWhiteSpace(originalScene))
{
EditorSceneManager.OpenScene(originalScene, OpenSceneMode.Single);
}
else
{
EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects);
}
}
static RuntimeUnitTestSettings LoadOrGetDefaultSettings()
{
var key = SettingsKeyBase + Application.productName;
var settingsValue = EditorPrefs.GetString(key, null);
RuntimeUnitTestSettings settings = null;
try
{
if (!string.IsNullOrWhiteSpace(settingsValue))
{
settings = JsonUtility.FromJson<RuntimeUnitTestSettings>(settingsValue);
}
}
catch
{
UnityEngine.Debug.LogError("Fail to load RuntimeUnitTest settings");
EditorPrefs.SetString(key, null);
settings = null;
}
if (settings == null)
{
// default
settings = new RuntimeUnitTestSettings
{
UseCurrentBuildTarget = true,
UseCurrentScriptBackend = true,
Headless = false,
AutoRunPlayer = true,
};
}
return settings;
}
static void SaveSettings(RuntimeUnitTestSettings settings)
{
var key = SettingsKeyBase + Application.productName;
EditorPrefs.SetString(key, JsonUtility.ToJson(settings));
}
public static void BuildUnitTest(string buildPath, ScriptingImplementation scriptBackend, BuildTarget buildTarget, bool headless, bool autoRunPlayer, bool disableAutoClose)
{
var sceneName = "Assets/TempRuntimeUnitTestScene_" + DateTimeOffset.UtcNow.ToUnixTimeSeconds();
if (disableAutoClose)
{
sceneName += "_DisableAutoClose";
}
sceneName += ".unity";
var scene = EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single);
BuildUnitTestRunnerScene();
EditorSceneManager.MarkSceneDirty(scene);
AssetDatabase.SaveAssets();
EditorSceneManager.SaveScene(scene, sceneName, false);
try
{
Build(sceneName, buildPath, new RuntimeUnitTestSettings { ScriptBackend = scriptBackend, BuildTarget = buildTarget, Headless = headless, AutoRunPlayer = autoRunPlayer, DisableAutoClose = disableAutoClose });
}
finally
{
AssetDatabase.DeleteAsset(sceneName);
}
}
public static UnitTestRunner BuildUnitTestRunnerScene()
{
const string kStandardSpritePath = "UI/Skin/UISprite.psd";
const string kBackgroundSpritePath = "UI/Skin/Background.psd";
var uisprite = AssetDatabase.GetBuiltinExtraResource<Sprite>(kStandardSpritePath);
var background = AssetDatabase.GetBuiltinExtraResource<Sprite>(kBackgroundSpritePath);
ScrollRect buttonList;
VerticalLayoutGroup listLayout;
Scrollbar refListScrollbar;
ScrollRect logList;
Scrollbar refLogScrollbar;
Button clearButton;
Text logText;
// Flutter like coded build utility
var rootObject = new Builder<Camera>("SceneRoot")
{
Children = new IBuilder[] {
new Builder<EventSystem, StandaloneInputModule>("EventSystem"),
new Builder<Canvas, CanvasScaler, GraphicRaycaster>("Canvas") {
Component1 = { renderMode = RenderMode.ScreenSpaceOverlay },
Children = new IBuilder[] {
new Builder<HorizontalLayoutGroup, CanvasRenderer>("HorizontalSplitter") {
RectTransform = { anchorMin = new Vector2(0, 0), anchorMax = new Vector2(1, 1) },
Component1 = { childControlWidth = true, childControlHeight = true, spacing = 10 },
Children = new IBuilder[] {
new Builder<ScrollRect, CanvasRenderer>("ButtonList", out buttonList) {
RectTransform = { pivot = new Vector2(0.5f, 0.5f) },
Component1 = { horizontal =false, vertical = true, movementType = ScrollRect.MovementType.Clamped },
Children = new IBuilder[] {
new Builder<VerticalLayoutGroup, ContentSizeFitter>("ListLayoutToAttach", out listLayout) {
RectTransform = { anchorMin = new Vector2(0, 0), anchorMax = new Vector2(1, 1), pivot = new Vector2(0, 1) },
Component1 = { childControlWidth = true, childControlHeight = true, childForceExpandWidth = true, childForceExpandHeight = false, spacing = 10, padding = new RectOffset(10,20,10,10) },
Component2 = { horizontalFit = ContentSizeFitter.FitMode.Unconstrained, verticalFit = ContentSizeFitter.FitMode.PreferredSize },
SetTarget = self => { buttonList.content = self.GetComponent<RectTransform>(); },
Child = new Builder<Button, Image, LayoutElement>("ClearButton", out clearButton) {
Component2 = { sprite = uisprite, type = Image.Type.Sliced },
Component3 = { minHeight = 50 },
SetTarget = self => { self.GetComponent<Button>().targetGraphic = self.GetComponent<Graphic>(); },
Child = new Builder<Text>("ButtonText") {
RectTransform = { anchorMin = new Vector2(0, 0), anchorMax = new Vector2(1, 1), pivot = new Vector2(0.5f, 0.5f) },
Component1 = { text = "Clear", color = FromRGB(50, 50, 50), alignment = TextAnchor.MiddleCenter, fontSize = 24, lineSpacing = 1 }
}
}
},
new Builder<Scrollbar,Image>("ListScrollbar", out refListScrollbar) {
RectTransform = { anchorMin = new Vector2(1, 0), anchorMax = new Vector2(1, 1) },
Component1 = { navigation = new Navigation{ mode = Navigation.Mode.None }, direction = Scrollbar.Direction.BottomToTop, size = 1.0f },
Component2 = { sprite = background, type = Image.Type.Sliced },
SetTarget = self => { buttonList.verticalScrollbar = self.GetComponent<Scrollbar>(); },
Child = new Builder<RectTransform>("Sliding Area") {
RectTransform = { anchorMin = new Vector2(0, 0), anchorMax = new Vector2(1, 1) },
Child = new Builder<Image>("Handle") {
Component1 = { sprite = uisprite, type = Image.Type.Sliced },
SetTarget = self =>
{
refListScrollbar.targetGraphic = self.GetComponent<Graphic>();
refListScrollbar.handleRect = self.GetComponent<RectTransform>();
}
}
}
}
}
},
new Builder<ScrollRect, CanvasRenderer>("ScrollableText", out logList) {
RectTransform = { pivot = new Vector2(0.5f, 0.5f) },
Component1 = { horizontal =false, vertical = true, movementType = ScrollRect.MovementType.Elastic, elasticity = 0.1f },
Children = new IBuilder[] {
new Builder<Text, ContentSizeFitter>("Log", out logText) {
RectTransform = { anchorMin = new Vector2(0, 0), anchorMax = new Vector2(1, 1), pivot = new Vector2(0, 1) },
Component1 = { fontSize = 24, lineSpacing = 1, supportRichText = true, alignment = TextAnchor.UpperLeft, horizontalOverflow = HorizontalWrapMode.Wrap, verticalOverflow = VerticalWrapMode.Truncate },
Component2 = { horizontalFit = ContentSizeFitter.FitMode.Unconstrained, verticalFit = ContentSizeFitter.FitMode.PreferredSize },
SetTarget = self => { logList.content = self.GetComponent<RectTransform>(); }
},
new Builder<Scrollbar,Image>("LogScrollbar", out refLogScrollbar) {
RectTransform = { anchorMin = new Vector2(1, 0), anchorMax = new Vector2(1, 1) },
Component1 = { navigation = new Navigation{ mode = Navigation.Mode.None }, direction = Scrollbar.Direction.BottomToTop, size = 1.0f },
Component2 = { sprite = background, type = Image.Type.Sliced },
SetTarget = self => { logList.verticalScrollbar = self.GetComponent<Scrollbar>(); },
Child = new Builder<RectTransform>("Sliding Area2") {
RectTransform = { anchorMin = new Vector2(0, 0), anchorMax = new Vector2(1, 1) },
Child = new Builder<Image>("Handle2") {
Component1 = { sprite = uisprite, type = Image.Type.Sliced },
SetTarget = self =>
{
refLogScrollbar.targetGraphic = self.GetComponent<Graphic>();
refLogScrollbar.handleRect = self.GetComponent<RectTransform>();
}
}
}
}
}
},
}
}
}
}
}
};
// size modify after build complete:)
{
var rect = GameObject.Find("HorizontalSplitter").GetComponent<RectTransform>();
rect.offsetMin = new Vector2(0, 0);
rect.offsetMax = new Vector2(0, 0);
}
{
var rect = GameObject.Find("ListLayoutToAttach").GetComponent<RectTransform>();
rect.offsetMin = new Vector2(0, 0);
rect.offsetMax = new Vector2(0, 0);
}
{
var rect = GameObject.Find("ListScrollbar").GetComponent<RectTransform>();
rect.offsetMin = new Vector2(0, 0);
rect.offsetMax = new Vector2(0, 0);
rect.sizeDelta = new Vector2(30, 0);
}
{
var rect = GameObject.Find("ClearButton").GetComponent<RectTransform>();
rect.offsetMin = new Vector2(0, 0);
rect.offsetMax = new Vector2(0, 0);
}
{
var rect = GameObject.Find("Sliding Area").GetComponent<RectTransform>();
rect.offsetMin = new Vector2(0, 0);
rect.offsetMax = new Vector2(0, 0);
rect.sizeDelta = new Vector2(-20, -20);
}
{
var rect = GameObject.Find("Handle").GetComponent<RectTransform>();
rect.offsetMin = new Vector2(0, 0);
rect.offsetMax = new Vector2(0, 0);
rect.sizeDelta = new Vector2(20, 20);
}
{
var rect = GameObject.Find("ButtonText").GetComponent<RectTransform>();
rect.offsetMin = new Vector2(0, 0);
rect.offsetMax = new Vector2(0, 0);
}
{
var rect = GameObject.Find("Log").GetComponent<RectTransform>();
rect.offsetMin = new Vector2(15, 0);
rect.offsetMax = new Vector2(-20, 0);
}
{
var rect = GameObject.Find("LogScrollbar").GetComponent<RectTransform>();
rect.offsetMin = new Vector2(-30, 0);
rect.offsetMax = new Vector2(0, 0);
rect.sizeDelta = new Vector2(30, 0);
}
{
var rect = GameObject.Find("Sliding Area2").GetComponent<RectTransform>();
rect.offsetMin = new Vector2(0, 0);
rect.offsetMax = new Vector2(0, 0);
rect.sizeDelta = new Vector2(-20, -20);
}
{
var rect = GameObject.Find("Handle2").GetComponent<RectTransform>();
rect.offsetMin = new Vector2(0, 0);
rect.offsetMax = new Vector2(0, 0);
rect.sizeDelta = new Vector2(20, 20);
}
// add test script
var runner = rootObject.GameObject.AddComponent<UnitTestRunner>();
runner.clearButton = clearButton;
runner.list = listLayout.gameObject.GetComponent<RectTransform>();
runner.listScrollBar = refListScrollbar;
runner.logText = logText;
runner.logScrollBar = refLogScrollbar;
return runner;
}
static void Build(string sceneName, string buildPath, RuntimeUnitTestSettings settings)
{
var options = BuildOptions.BuildScriptsOnly | BuildOptions.IncludeTestAssemblies;
if (settings.AutoRunPlayer)
{
options |= BuildOptions.AutoRunPlayer;
}
if (settings.Headless)
{
options |= BuildOptions.EnableHeadlessMode;
}
var targetGroup = ToBuildTargetGroup(settings.BuildTarget);
var currentBackend = PlayerSettings.GetScriptingBackend(targetGroup);
if (currentBackend != settings.ScriptBackend)
{
UnityEngine.Debug.Log("Modify ScriptBackend to " + settings.ScriptBackend);
PlayerSettings.SetScriptingBackend(targetGroup, settings.ScriptBackend);
}
var buildOptions = new BuildPlayerOptions
{
target = settings.BuildTarget,
targetGroup = targetGroup,
options = options,
scenes = new[] { sceneName },
locationPathName = buildPath
};
UnityEngine.Debug.Log("UnitTest Build Start, " + settings.ToString());
var buildReport = BuildPipeline.BuildPlayer(buildOptions);
if (currentBackend != settings.ScriptBackend)
{
UnityEngine.Debug.Log("Restore ScriptBackend to " + currentBackend);
PlayerSettings.SetScriptingBackend(targetGroup, currentBackend);
}
if (buildReport.summary.result != BuildResult.Succeeded)
{
// Note: show error summary?
// Debug.LogError(buildReport.SummarizeErrors());
UnityEngine.Debug.LogError("UnitTest Build Failed.");
}
else
{
UnityEngine.Debug.Log("UnitTest Build Completed, binary located: " + buildOptions.locationPathName);
}
}
static Color FromRGB(int r, int g, int b)
{
return new Color(r / 255f, g / 255f, b / 255f);
}
static bool IsWindows(BuildTarget buildTarget)
{
switch (buildTarget)
{
case BuildTarget.StandaloneWindows:
case BuildTarget.StandaloneWindows64:
case BuildTarget.WSAPlayer:
return true;
default:
return false;
}
}
static BuildTargetGroup ToBuildTargetGroup(BuildTarget buildTarget)
{
#pragma warning disable CS0618
switch (buildTarget)
{
case BuildTarget.StandaloneOSX:
case (BuildTarget)3:
case BuildTarget.StandaloneOSXIntel:
case BuildTarget.StandaloneOSXIntel64:
case BuildTarget.StandaloneWindows:
case BuildTarget.StandaloneWindows64:
case BuildTarget.StandaloneLinux:
case BuildTarget.StandaloneLinux64:
case BuildTarget.StandaloneLinuxUniversal:
return BuildTargetGroup.Standalone;
case (BuildTarget)6:
case (BuildTarget)7:
case BuildTarget.WebGL:
return BuildTargetGroup.WebGL;
case BuildTarget.iOS:
return BuildTargetGroup.iOS;
case BuildTarget.PS3:
return BuildTargetGroup.PS3;
case BuildTarget.PS4:
return BuildTargetGroup.PS4;
case BuildTarget.XBOX360:
return BuildTargetGroup.XBOX360;
case BuildTarget.Android:
return BuildTargetGroup.Android;
case BuildTarget.WSAPlayer:
return BuildTargetGroup.WSA;
case BuildTarget.WP8Player:
return BuildTargetGroup.WP8;
case BuildTarget.Tizen:
return BuildTargetGroup.Tizen;
case BuildTarget.PSP2:
return BuildTargetGroup.PSP2;
case BuildTarget.PSM:
return BuildTargetGroup.PSM;
case BuildTarget.XboxOne:
return BuildTargetGroup.XboxOne;
case BuildTarget.SamsungTV:
return BuildTargetGroup.SamsungTV;
case BuildTarget.N3DS:
return BuildTargetGroup.N3DS;
case BuildTarget.WiiU:
return BuildTargetGroup.WiiU;
case BuildTarget.tvOS:
return BuildTargetGroup.tvOS;
case BuildTarget.Switch:
return BuildTargetGroup.Switch;
case BuildTarget.Lumin:
return BuildTargetGroup.Lumin;
case BuildTarget.BlackBerry:
return BuildTargetGroup.BlackBerry;
case BuildTarget.NoTarget:
default:
return BuildTargetGroup.Unknown;
}
#pragma warning restore CS0618
}
}
#endif

View File

@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 3518da33b6245d341a0ef3670ee9268b
timeCreated: 1488689723
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,450 +0,0 @@
using NUnit.Framework;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.TestTools;
using UnityEngine.UI;
namespace RuntimeUnitTestToolkit
{
public class UnitTestRunner : MonoBehaviour
{
// object is IEnumerator or Func<IEnumerator>
Dictionary<string, List<KeyValuePair<string, object>>> tests = new Dictionary<string, List<KeyValuePair<string, object>>>();
List<Pair> additionalActionsOnFirst = new List<Pair>();
public Button clearButton;
public RectTransform list;
public Scrollbar listScrollBar;
public Text logText;
public Scrollbar logScrollBar;
readonly Color passColor = new Color(0f, 1f, 0f, 1f); // green
readonly Color failColor = new Color(1f, 0f, 0f, 1f); // red
readonly Color normalColor = new Color(1f, 1f, 1f, 1f); // white
bool allTestGreen = true;
void Start()
{
try
{
UnityEngine.Application.logMessageReceived += (a, b, c) =>
{
logText.text += "[" + c + "]" + a + "\n";
};
// register all test types
foreach (var item in GetTestTargetTypes())
{
RegisterAllMethods(item);
}
var executeAll = new List<Func<Coroutine>>();
foreach (var ___item in tests)
{
var actionList = ___item; // be careful, capture in lambda
executeAll.Add(() => StartCoroutine(RunTestInCoroutine(actionList)));
Add(actionList.Key, () => StartCoroutine(RunTestInCoroutine(actionList)));
}
var executeAllButton = Add("Run All Tests", () => StartCoroutine(ExecuteAllInCoroutine(executeAll)));
clearButton.gameObject.GetComponent<Image>().color = new Color(170 / 255f, 170 / 255f, 170 / 255f, 1);
executeAllButton.gameObject.GetComponent<Image>().color = new Color(250 / 255f, 150 / 255f, 150 / 255f, 1);
executeAllButton.transform.SetSiblingIndex(1);
additionalActionsOnFirst.Reverse();
foreach (var item in additionalActionsOnFirst)
{
var newButton = GameObject.Instantiate(clearButton);
newButton.name = item.Name;
newButton.onClick.RemoveAllListeners();
newButton.GetComponentInChildren<Text>().text = item.Name;
newButton.onClick.AddListener(item.Action);
newButton.transform.SetParent(list);
newButton.transform.SetSiblingIndex(1);
}
clearButton.onClick.AddListener(() =>
{
logText.text = "";
foreach (var btn in list.GetComponentsInChildren<Button>())
{
btn.interactable = true;
btn.GetComponent<Image>().color = normalColor;
}
executeAllButton.gameObject.GetComponent<Image>().color = new Color(250 / 255f, 150 / 255f, 150 / 255f, 1);
});
listScrollBar.value = 1;
logScrollBar.value = 1;
if (Application.isBatchMode)
{
// run immediately in player
StartCoroutine(ExecuteAllInCoroutine(executeAll));
}
}
catch (Exception ex)
{
if (Application.isBatchMode)
{
// when failed(can not start runner), quit immediately.
WriteToConsole(ex.ToString());
Application.Quit(1);
}
else
{
throw;
}
}
}
Button Add(string title, UnityAction test)
{
var newButton = GameObject.Instantiate(clearButton);
newButton.name = title;
newButton.onClick.RemoveAllListeners();
newButton.GetComponentInChildren<Text>().text = title;
newButton.onClick.AddListener(test);
newButton.transform.SetParent(list);
return newButton;
}
static IEnumerable<Type> GetTestTargetTypes()
{
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
var n = assembly.FullName;
if (n.StartsWith("UnityEngine")) continue;
if (n.StartsWith("mscorlib")) continue;
if (n.StartsWith("System")) continue;
foreach (var item in assembly.GetTypes())
{
foreach (var method in item.GetMethods())
{
var t1 = method.GetCustomAttribute<TestAttribute>(true);
if (t1 != null)
{
yield return item;
break;
}
var t2 = method.GetCustomAttribute<UnityTestAttribute>(true);
if (t2 != null)
{
yield return item;
break;
}
}
}
}
}
public void AddTest(string group, string title, Action test)
{
List<KeyValuePair<string, object>> list;
if (!tests.TryGetValue(group, out list))
{
list = new List<KeyValuePair<string, object>>();
tests[group] = list;
}
list.Add(new KeyValuePair<string, object>(title, test));
}
public void AddAsyncTest(string group, string title, Func<IEnumerator> asyncTestCoroutine)
{
List<KeyValuePair<string, object>> list;
if (!tests.TryGetValue(group, out list))
{
list = new List<KeyValuePair<string, object>>();
tests[group] = list;
}
list.Add(new KeyValuePair<string, object>(title, asyncTestCoroutine));
}
public void AddCutomAction(string name, UnityAction action)
{
additionalActionsOnFirst.Add(new Pair { Name = name, Action = action });
}
public void RegisterAllMethods<T>()
where T : new()
{
RegisterAllMethods(typeof(T));
}
public void RegisterAllMethods(Type testType)
{
try
{
var test = Activator.CreateInstance(testType);
var methods = testType.GetMethods(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public);
foreach (var item in methods)
{
try
{
var iteratorTest = item.GetCustomAttribute<UnityEngine.TestTools.UnityTestAttribute>(true);
if (iteratorTest != null)
{
if (item.GetParameters().Length == 0 && item.ReturnType == typeof(IEnumerator))
{
var factory = (Func<IEnumerator>)Delegate.CreateDelegate(typeof(Func<IEnumerator>), test, item);
AddAsyncTest(factory.Target.GetType().Name, factory.Method.Name, factory);
}
else
{
UnityEngine.Debug.Log(testType.Name + "." + item.Name + " currently does not supported in RuntumeUnitTestToolkit(multiple parameter or return type is invalid).");
}
}
var standardTest = item.GetCustomAttribute<NUnit.Framework.TestAttribute>(true);
if (standardTest != null)
{
if (item.GetParameters().Length == 0 && item.ReturnType == typeof(void))
{
var invoke = (Action)Delegate.CreateDelegate(typeof(Action), test, item);
AddTest(invoke.Target.GetType().Name, invoke.Method.Name, invoke);
}
else
{
UnityEngine.Debug.Log(testType.Name + "." + item.Name + " currently does not supported in RuntumeUnitTestToolkit(multiple parameter or return type is invalid).");
}
}
}
catch (Exception e)
{
UnityEngine.Debug.LogError(testType.Name + "." + item.Name + " failed to register method, exception: " + e.ToString());
}
}
}
catch (Exception ex)
{
Debug.LogException(ex);
}
}
System.Collections.IEnumerator ScrollLogToEndNextFrame()
{
yield return null;
yield return null;
logScrollBar.value = 0;
}
IEnumerator RunTestInCoroutine(KeyValuePair<string, List<KeyValuePair<string, object>>> actionList)
{
Button self = null;
foreach (var btn in list.GetComponentsInChildren<Button>())
{
btn.interactable = false;
if (btn.name == actionList.Key) self = btn;
}
if (self != null)
{
self.GetComponent<Image>().color = normalColor;
}
var allGreen = true;
logText.text += "<color=yellow>" + actionList.Key + "</color>\n";
WriteToConsole("Begin Test Class: " + actionList.Key);
yield return null;
var totalExecutionTime = new List<double>();
foreach (var item2 in actionList.Value)
{
// before start, cleanup
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
logText.text += "<color=teal>" + item2.Key + "</color>\n";
yield return null;
var v = item2.Value;
var methodStopwatch = System.Diagnostics.Stopwatch.StartNew();
Exception exception = null;
if (v is Action)
{
try
{
((Action)v).Invoke();
}
catch (Exception ex)
{
exception = ex;
}
}
else
{
var coroutineFactory = (Func<IEnumerator>)v;
IEnumerator coroutine = null;
try
{
coroutine = coroutineFactory();
}
catch (Exception ex)
{
exception = ex;
}
if (exception == null)
{
yield return StartCoroutine(UnwrapEnumerator(coroutine, ex =>
{
exception = ex;
}));
}
}
methodStopwatch.Stop();
totalExecutionTime.Add(methodStopwatch.Elapsed.TotalMilliseconds);
if (exception == null)
{
logText.text += "OK, " + methodStopwatch.Elapsed.TotalMilliseconds.ToString("0.00") + "ms\n";
WriteToConsoleResult(item2.Key + ", " + methodStopwatch.Elapsed.TotalMilliseconds.ToString("0.00") + "ms", true);
}
else
{
// found match line...
var line = string.Join("\n", exception.StackTrace.Split('\n').Where(x => x.Contains(actionList.Key) || x.Contains(item2.Key)).ToArray());
logText.text += "<color=red>" + exception.Message + "\n" + line + "</color>\n";
WriteToConsoleResult(item2.Key + ", " + exception.Message, false);
WriteToConsole(line);
allGreen = false;
allTestGreen = false;
}
}
logText.text += "[" + actionList.Key + "]" + totalExecutionTime.Sum().ToString("0.00") + "ms\n\n";
foreach (var btn in list.GetComponentsInChildren<Button>()) btn.interactable = true;
if (self != null)
{
self.GetComponent<Image>().color = allGreen ? passColor : failColor;
}
yield return StartCoroutine(ScrollLogToEndNextFrame());
}
IEnumerator ExecuteAllInCoroutine(List<Func<Coroutine>> tests)
{
allTestGreen = true;
foreach (var item in tests)
{
yield return item();
}
if (Application.isBatchMode)
{
var scene = UnityEngine.SceneManagement.SceneManager.GetActiveScene();
bool disableAutoClose = (scene.name.Contains("DisableAutoClose"));
if (allTestGreen)
{
WriteToConsole("Test Complete Successfully");
if (!disableAutoClose)
{
Application.Quit();
}
}
else
{
WriteToConsole("Test Failed, please see [NG] log.");
if (!disableAutoClose)
{
Application.Quit(1);
}
}
}
}
IEnumerator UnwrapEnumerator(IEnumerator enumerator, Action<Exception> exceptionCallback)
{
var hasNext = true;
while (hasNext)
{
try
{
hasNext = enumerator.MoveNext();
}
catch (Exception ex)
{
exceptionCallback(ex);
hasNext = false;
}
if (hasNext)
{
// unwrap self for bug of Unity
// https://issuetracker.unity3d.com/issues/does-not-stop-coroutine-when-it-throws-exception-in-movenext-at-first-frame
var moreCoroutine = enumerator.Current as IEnumerator;
if (moreCoroutine != null)
{
yield return StartCoroutine(UnwrapEnumerator(moreCoroutine, ex =>
{
exceptionCallback(ex);
hasNext = false;
}));
}
else
{
yield return enumerator.Current;
}
}
}
}
static void WriteToConsole(string msg)
{
if (Application.isBatchMode)
{
Console.WriteLine(msg);
}
}
static void WriteToConsoleResult(string msg, bool green)
{
if (Application.isBatchMode)
{
if (!green)
{
var currentForeground = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Red;
Console.Write("[NG]");
Console.ForegroundColor = currentForeground;
}
else
{
var currentForeground = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Green;
Console.Write("[OK]");
Console.ForegroundColor = currentForeground;
}
System.Console.WriteLine(msg);
}
}
struct Pair
{
public string Name;
public UnityAction Action;
}
}
}

View File

@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 660baed073888b8438569f57e42679b2
timeCreated: 1476793308
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,11 +0,0 @@
{
"name": "jp.cysharp.runtimeunittesttoolkit",
"displayName": "RuntimeUnitTestToolkit",
"version": "2.0.0",
"unity": "2018.3",
"description": "CLI/GUI Frontend of Unity Test Runner to test on any platform.",
"keywords": ["test"],
"category": "Tests",
"dependencies": {
}
}

View File

@@ -1,26 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using UniRx.Async;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
public class SandboxMain : MonoBehaviour
{
public Button okButton;
public Button cancelButton;
CancellationTokenSource cts;
async void Start()
{
UnityEngine.Debug.Log("DOWNLOAD START:" + Time.frameCount);
var req = await UnityWebRequest.Get(Path.Combine(Application.streamingAssetsPath, "test.txt")).SendWebRequest();
UnityEngine.Debug.Log("DOWNLOAD RESULT:" + Time.frameCount + ", " + req.downloadHandler.text);
}
}

View File

@@ -1,405 +0,0 @@
#if !(UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2)
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine.UI;
using UnityEngine.Scripting;
using UniRx;
using UniRx.Async;
using UnityEngine.SceneManagement;
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
using System.Threading.Tasks;
#endif
using UnityEngine.Networking;
#if !UNITY_2019_3_OR_NEWER
using UnityEngine.Experimental.LowLevel;
#else
using UnityEngine.LowLevel;
#endif
#if !UNITY_WSA
using Unity.Jobs;
#endif
using Unity.Collections;
using System.Threading;
using NUnit.Framework;
using UnityEngine.TestTools;
using FluentAssertions;
namespace UniRx.AsyncTests
{
public class AsyncTest
{
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#if !UNITY_WSA
public struct MyJob : IJob
{
public int loopCount;
public NativeArray<int> inOut;
public int result;
public void Execute()
{
result = 0;
for (int i = 0; i < loopCount; i++)
{
result++;
}
inOut[0] = result;
}
}
[UnityTest]
public IEnumerator DelayAnd() => UniTask.ToCoroutine(async () =>
{
await UniTask.Yield(PlayerLoopTiming.PostLateUpdate);
var time = Time.realtimeSinceStartup;
Time.timeScale = 0.5f;
try
{
await UniTask.Delay(TimeSpan.FromSeconds(3));
var elapsed = Time.realtimeSinceStartup - time;
((int)Math.Round(TimeSpan.FromSeconds(elapsed).TotalSeconds, MidpointRounding.ToEven)).Should().Be(6);
}
finally
{
Time.timeScale = 1.0f;
}
});
[UnityTest]
public IEnumerator DelayIgnore() => UniTask.ToCoroutine(async () =>
{
var time = Time.realtimeSinceStartup;
Time.timeScale = 0.5f;
try
{
await UniTask.Delay(TimeSpan.FromSeconds(3), ignoreTimeScale: true);
var elapsed = Time.realtimeSinceStartup - time;
((int)Math.Round(TimeSpan.FromSeconds(elapsed).TotalSeconds, MidpointRounding.ToEven)).Should().Be(3);
}
finally
{
Time.timeScale = 1.0f;
}
});
[UnityTest]
public IEnumerator WhenAll() => UniTask.ToCoroutine(async () =>
{
var a = UniTask.FromResult(999);
var b = UniTask.Yield(PlayerLoopTiming.Update, CancellationToken.None).AsAsyncUnitUniTask();
var c = UniTask.DelayFrame(99);
var (a2, b2, c2) = await UniTask.WhenAll(a, b, c);
a2.Should().Be(999);
b2.Should().Be(AsyncUnit.Default);
c2.Should().Be(99);
});
[UnityTest]
public IEnumerator WhenAny() => UniTask.ToCoroutine(async () =>
{
var a = UniTask.FromResult(999);
var b = UniTask.Yield(PlayerLoopTiming.Update, CancellationToken.None).AsAsyncUnitUniTask();
var c = UniTask.DelayFrame(99);
var (win, a2, b2, c2) = await UniTask.WhenAny(a, b, c);
win.Should().Be(0);
a2.hasResult.Should().Be(true);
a2.result0.Should().Be(999);
b2.hasResult.Should().Be(false);
c2.hasResult.Should().Be(false);
});
[UnityTest]
public IEnumerator BothEnumeratorCheck() => UniTask.ToCoroutine(async () =>
{
await ToaruCoroutineEnumerator(); // wait 5 frame:)
await ToaruCoroutineEnumerator().ConfigureAwait(PlayerLoopTiming.PostLateUpdate);
});
[UnityTest]
public IEnumerator JobSystem() => UniTask.ToCoroutine(async () =>
{
var job = new MyJob() { loopCount = 999, inOut = new NativeArray<int>(1, Allocator.TempJob) };
JobHandle.ScheduleBatchedJobs();
await job.Schedule();
job.inOut[0].Should().Be(999);
job.inOut.Dispose();
});
class MyMyClass
{
public int MyProperty { get; set; }
}
[UnityTest]
public IEnumerator WaitUntil() => UniTask.ToCoroutine(async () =>
{
bool t = false;
await UniTask.Yield(PlayerLoopTiming.PostLateUpdate);
UniTask.DelayFrame(10,PlayerLoopTiming.PostLateUpdate).ContinueWith(_ => t = true).Forget();
var startFrame = Time.frameCount;
await UniTask.WaitUntil(() => t, PlayerLoopTiming.EarlyUpdate);
var diff = Time.frameCount - startFrame;
diff.Should().Be(11);
});
[UnityTest]
public IEnumerator WaitWhile() => UniTask.ToCoroutine(async () =>
{
bool t = true;
UniTask.DelayFrame(10, PlayerLoopTiming.PostLateUpdate).ContinueWith(_ => t = false).Forget();
var startFrame = Time.frameCount;
await UniTask.WaitWhile(() => t, PlayerLoopTiming.EarlyUpdate);
var diff = Time.frameCount - startFrame;
diff.Should().Be(11);
});
[UnityTest]
public IEnumerator WaitUntilValueChanged() => UniTask.ToCoroutine(async () =>
{
var v = new MyMyClass { MyProperty = 99 };
UniTask.DelayFrame(10, PlayerLoopTiming.PostLateUpdate).ContinueWith(_ => v.MyProperty = 1000).Forget();
var startFrame = Time.frameCount;
await UniTask.WaitUntilValueChanged(v, x => x.MyProperty, PlayerLoopTiming.EarlyUpdate);
var diff = Time.frameCount - startFrame;
diff.Should().Be(11);
});
[UnityTest]
public IEnumerator SwitchTo() => UniTask.ToCoroutine(async () =>
{
await UniTask.Yield();
var currentThreadId = Thread.CurrentThread.ManagedThreadId;
await UniTask.SwitchToThreadPool();
//await UniTask.SwitchToThreadPool();
//await UniTask.SwitchToThreadPool();
var switchedThreadId = Thread.CurrentThread.ManagedThreadId;
currentThreadId.Should().NotBe(switchedThreadId);
await UniTask.Yield();
var switchedThreadId2 = Thread.CurrentThread.ManagedThreadId;
currentThreadId.Should().Be(switchedThreadId2);
});
//[UnityTest]
//public IEnumerator ObservableConversion() => UniTask.ToCoroutine(async () =>
//{
// var v = await Observable.Range(1, 10).ToUniTask();
// v.Is(10);
// v = await Observable.Range(1, 10).ToUniTask(useFirstValue: true);
// v.Is(1);
// v = await UniTask.DelayFrame(10).ToObservable().ToTask();
// v.Is(10);
// v = await UniTask.FromResult(99).ToObservable();
// v.Is(99);
//});
//[UnityTest]
//public IEnumerator AwaitableReactiveProperty() => UniTask.ToCoroutine(async () =>
//{
// var rp1 = new ReactiveProperty<int>(99);
// UniTask.DelayFrame(100).ContinueWith(x => rp1.Value = x).Forget();
// await rp1;
// rp1.Value.Is(100);
// // var delay2 = UniTask.DelayFrame(10);
// // var (a, b ) = await UniTask.WhenAll(rp1.WaitUntilValueChangedAsync(), delay2);
//});
//[UnityTest]
//public IEnumerator AwaitableReactiveCommand() => UniTask.ToCoroutine(async () =>
//{
// var rc = new ReactiveCommand<int>();
// UniTask.DelayFrame(100).ContinueWith(x => rc.Execute(x)).Forget();
// var v = await rc;
// v.Is(100);
//});
[UnityTest]
public IEnumerator ExceptionlessCancellation() => UniTask.ToCoroutine(async () =>
{
var cts = new CancellationTokenSource();
UniTask.DelayFrame(10).ContinueWith(_ => cts.Cancel()).Forget();
var first = Time.frameCount;
var (canceled, value) = await UniTask.DelayFrame(100, cancellationToken: cts.Token).SuppressCancellationThrow();
(Time.frameCount - first).Should().Be(11); // 10 frame canceled
canceled.Should().Be(true);
});
[UnityTest]
public IEnumerator ExceptionCancellation() => UniTask.ToCoroutine(async () =>
{
var cts = new CancellationTokenSource();
UniTask.DelayFrame(10).ContinueWith(_ => cts.Cancel()).Forget();
bool occur = false;
try
{
var value = await UniTask.DelayFrame(100, cancellationToken: cts.Token);
}
catch (OperationCanceledException)
{
occur = true;
}
occur.Should().BeTrue();
});
IEnumerator ToaruCoroutineEnumerator()
{
yield return null;
yield return null;
yield return null;
yield return null;
yield return null;
}
[UnityTest]
public IEnumerator ExceptionUnobserved1() => UniTask.ToCoroutine(async () =>
{
bool calledEx = false;
Action<Exception> action = exx =>
{
calledEx = true;
exx.Message.Should().Be("MyException");
};
UniTaskScheduler.UnobservedTaskException += action;
var ex = InException1();
ex = default(UniTask);
await UniTask.DelayFrame(3);
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
await UniTask.DelayFrame(1);
calledEx.Should().BeTrue();
UniTaskScheduler.UnobservedTaskException -= action;
});
[UnityTest]
public IEnumerator ExceptionUnobserved2() => UniTask.ToCoroutine(async () =>
{
bool calledEx = false;
Action<Exception> action = exx =>
{
calledEx = true;
exx.Message.Should().Be("MyException");
};
UniTaskScheduler.UnobservedTaskException += action;
var ex = InException2();
ex = default(UniTask<int>);
await UniTask.DelayFrame(3);
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
await UniTask.DelayFrame(1);
calledEx.Should().BeTrue();
UniTaskScheduler.UnobservedTaskException -= action;
});
async UniTask InException1()
{
await UniTask.Yield();
throw new Exception("MyException");
}
async UniTask<int> InException2()
{
await UniTask.Yield();
throw new Exception("MyException");
}
[UnityTest]
public IEnumerator NestedEnumerator() => UniTask.ToCoroutine(async () =>
{
var time = Time.realtimeSinceStartup;
await ParentCoroutineEnumerator();
var elapsed = Time.realtimeSinceStartup - time;
((int)Math.Round(TimeSpan.FromSeconds(elapsed).TotalSeconds, MidpointRounding.ToEven)).Should().Be(3);
});
IEnumerator ParentCoroutineEnumerator()
{
yield return ChildCoroutineEnumerator();
}
IEnumerator ChildCoroutineEnumerator()
{
yield return new WaitForSeconds(3);
}
#endif
#endif
}
}
#endif

View File

@@ -1,96 +0,0 @@
#if !(UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2)
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine.UI;
using UnityEngine.Scripting;
using UniRx;
using UniRx.Async;
using UnityEngine.SceneManagement;
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
using System.Threading.Tasks;
#endif
using UnityEngine.Networking;
#if !UNITY_2019_3_OR_NEWER
using UnityEngine.Experimental.LowLevel;
#else
using UnityEngine.LowLevel;
#endif
#if !UNITY_WSA
using Unity.Jobs;
#endif
using Unity.Collections;
using System.Threading;
using NUnit.Framework;
using UnityEngine.TestTools;
using FluentAssertions;
namespace UniRx.AsyncTests
{
public class RunTest
{
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#if !UNITY_WSA
//[UnityTest]
//public IEnumerator RunThread() => UniTask.ToCoroutine(async () =>
//{
// var main = Thread.CurrentThread.ManagedThreadId;
// var v = await UniTask.Run(() => { return System.Threading.Thread.CurrentThread.ManagedThreadId; }, false);
// UnityEngine.Debug.Log("Ret Value is:" + v);
// UnityEngine.Debug.Log("Run Here and id:" + System.Threading.Thread.CurrentThread.ManagedThreadId);
// //v.Should().Be(3);
// main.Should().NotBe(Thread.CurrentThread.ManagedThreadId);
//});
[UnityTest]
public IEnumerator RunThreadConfigure() => UniTask.ToCoroutine(async () =>
{
var main = Thread.CurrentThread.ManagedThreadId;
var v = await UniTask.Run(() => 3, true);
v.Should().Be(3);
main.Should().Be(Thread.CurrentThread.ManagedThreadId);
});
//[UnityTest]
//public IEnumerator RunThreadException() => UniTask.ToCoroutine(async () =>
//{
// var main = Thread.CurrentThread.ManagedThreadId;
// try
// {
// await UniTask.Run<int>(() => throw new Exception(), false);
// }
// catch
// {
// main.Should().NotBe(Thread.CurrentThread.ManagedThreadId);
// }
//});
[UnityTest]
public IEnumerator RunThreadExceptionConfigure() => UniTask.ToCoroutine(async () =>
{
var main = Thread.CurrentThread.ManagedThreadId;
try
{
await UniTask.Run<int>(() => throw new Exception(), true);
}
catch
{
main.Should().Be(Thread.CurrentThread.ManagedThreadId);
}
});
#endif
#endif
}
}
#endif

View File

@@ -1,44 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine.UI;
using UnityEngine.Scripting;
using UniRx;
using UniRx.Async;
using Unity.Collections;
using System.Threading;
using NUnit.Framework;
using UnityEngine.TestTools;
using FluentAssertions;
namespace UniRx.AsyncTests
{
public class WhenAnyTest
{
[UnityTest]
public IEnumerator WhenAnyCanceled() => UniTask.ToCoroutine(async () =>
{
var cts = new CancellationTokenSource();
var successDelayTask = UniTask.Delay(TimeSpan.FromSeconds(1));
var cancelTask = UniTask.Delay(TimeSpan.FromSeconds(1), cancellationToken: cts.Token);
cts.CancelAfterSlim(200);
try
{
var r = await UniTask.WhenAny(new[] { successDelayTask, cancelTask });
}
catch (Exception ex)
{
ex.Should().BeAssignableTo<OperationCanceledException>();
}
});
}
}
#endif

View File

@@ -1,76 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System;
using System.Threading;
namespace UniRx.Async
{
public static class CancellationTokenExtensions
{
static readonly Action<object> cancellationTokenCallback = Callback;
public static (UniTask, CancellationTokenRegistration) ToUniTask(this CancellationToken cts)
{
if (cts.IsCancellationRequested)
{
return (UniTask.FromCanceled(cts), default(CancellationTokenRegistration));
}
var promise = new UniTaskCompletionSource<AsyncUnit>();
return (promise.Task, cts.RegisterWithoutCaptureExecutionContext(cancellationTokenCallback, promise));
}
static void Callback(object state)
{
var promise = (UniTaskCompletionSource<AsyncUnit>)state;
promise.TrySetResult(AsyncUnit.Default);
}
public static CancellationTokenRegistration RegisterWithoutCaptureExecutionContext(this CancellationToken cancellationToken, Action callback)
{
var restoreFlow = false;
if (!ExecutionContext.IsFlowSuppressed())
{
ExecutionContext.SuppressFlow();
restoreFlow = true;
}
try
{
return cancellationToken.Register(callback, false);
}
finally
{
if (restoreFlow)
{
ExecutionContext.RestoreFlow();
}
}
}
public static CancellationTokenRegistration RegisterWithoutCaptureExecutionContext(this CancellationToken cancellationToken, Action<object> callback, object state)
{
var restoreFlow = false;
if (!ExecutionContext.IsFlowSuppressed())
{
ExecutionContext.SuppressFlow();
restoreFlow = true;
}
try
{
return cancellationToken.Register(callback, state, false);
}
finally
{
if (restoreFlow)
{
ExecutionContext.RestoreFlow();
}
}
}
}
}
#endif

View File

@@ -1,48 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Threading;
using UnityEngine;
using UniRx.Async.Triggers;
using System;
namespace UniRx.Async
{
public static class CancellationTokenSourceExtensions
{
public static void CancelAfterSlim(this CancellationTokenSource cts, int millisecondsDelay, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update)
{
var delay = UniTask.Delay(millisecondsDelay, ignoreTimeScale, delayTiming, cts.Token);
CancelAfterCore(cts, delay).Forget();
}
public static void CancelAfterSlim(this CancellationTokenSource cts, TimeSpan delayTimeSpan, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update)
{
var delay = UniTask.Delay(delayTimeSpan, ignoreTimeScale, delayTiming, cts.Token);
CancelAfterCore(cts, delay).Forget();
}
static async UniTaskVoid CancelAfterCore(CancellationTokenSource cts, UniTask delayTask)
{
var alreadyCanceled = await delayTask.SuppressCancellationThrow();
if (!alreadyCanceled)
{
cts.Cancel();
cts.Dispose();
}
}
public static void RegisterRaiseCancelOnDestroy(this CancellationTokenSource cts, Component component)
{
RegisterRaiseCancelOnDestroy(cts, component.gameObject);
}
public static void RegisterRaiseCancelOnDestroy(this CancellationTokenSource cts, GameObject gameObject)
{
var trigger = gameObject.GetAsyncDestroyTrigger();
trigger.AddCancellationTriggerOnDestroy(cts);
}
}
}
#endif

View File

@@ -1,90 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Security;
namespace UniRx.Async.CompilerServices
{
public struct AsyncUniTaskVoidMethodBuilder
{
Action moveNext;
// 1. Static Create method.
[DebuggerHidden]
public static AsyncUniTaskVoidMethodBuilder Create()
{
var builder = new AsyncUniTaskVoidMethodBuilder();
return builder;
}
// 2. TaskLike Task property(void)
public UniTaskVoid Task => default(UniTaskVoid);
// 3. SetException
[DebuggerHidden]
public void SetException(Exception exception)
{
UniTaskScheduler.PublishUnobservedTaskException(exception);
}
// 4. SetResult
[DebuggerHidden]
public void SetResult()
{
// do nothing
}
// 5. AwaitOnCompleted
[DebuggerHidden]
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine)
where TAwaiter : INotifyCompletion
where TStateMachine : IAsyncStateMachine
{
if (moveNext == null)
{
var runner = new MoveNextRunner<TStateMachine>();
moveNext = runner.Run;
runner.StateMachine = stateMachine; // set after create delegate.
}
awaiter.OnCompleted(moveNext);
}
// 6. AwaitUnsafeOnCompleted
[DebuggerHidden]
[SecuritySafeCritical]
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine)
where TAwaiter : ICriticalNotifyCompletion
where TStateMachine : IAsyncStateMachine
{
if (moveNext == null)
{
var runner = new MoveNextRunner<TStateMachine>();
moveNext = runner.Run;
runner.StateMachine = stateMachine; // set after create delegate.
}
awaiter.UnsafeOnCompleted(moveNext);
}
// 7. Start
[DebuggerHidden]
public void Start<TStateMachine>(ref TStateMachine stateMachine)
where TStateMachine : IAsyncStateMachine
{
stateMachine.MoveNext();
}
// 8. SetStateMachine
[DebuggerHidden]
public void SetStateMachine(IAsyncStateMachine stateMachine)
{
}
}
}
#endif

View File

@@ -1,23 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Diagnostics;
using System.Runtime.CompilerServices;
namespace UniRx.Async.CompilerServices
{
internal class MoveNextRunner<TStateMachine>
where TStateMachine : IAsyncStateMachine
{
public TStateMachine StateMachine;
[DebuggerHidden]
public void Run()
{
StateMachine.MoveNext();
}
}
}
#endif

View File

@@ -1,246 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System;
using System.Collections;
using System.Reflection;
using System.Runtime.ExceptionServices;
using System.Threading;
using UniRx.Async.Internal;
using UnityEngine;
namespace UniRx.Async
{
public static class EnumeratorAsyncExtensions
{
public static IAwaiter GetAwaiter(this IEnumerator enumerator)
{
var awaiter = new EnumeratorAwaiter(enumerator, CancellationToken.None);
if (!awaiter.IsCompleted)
{
PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, awaiter);
}
return awaiter;
}
public static UniTask ToUniTask(this IEnumerator enumerator)
{
var awaiter = new EnumeratorAwaiter(enumerator, CancellationToken.None);
if (!awaiter.IsCompleted)
{
PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, awaiter);
}
return new UniTask(awaiter);
}
public static UniTask ConfigureAwait(this IEnumerator enumerator, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken))
{
var awaiter = new EnumeratorAwaiter(enumerator, cancellationToken);
if (!awaiter.IsCompleted)
{
PlayerLoopHelper.AddAction(timing, awaiter);
}
return new UniTask(awaiter);
}
class EnumeratorAwaiter : IAwaiter, IPlayerLoopItem
{
IEnumerator innerEnumerator;
CancellationToken cancellationToken;
Action continuation;
AwaiterStatus status;
ExceptionDispatchInfo exception;
public EnumeratorAwaiter(IEnumerator innerEnumerator, CancellationToken cancellationToken)
{
if (cancellationToken.IsCancellationRequested)
{
status = AwaiterStatus.Canceled;
return;
}
this.innerEnumerator = ConsumeEnumerator(innerEnumerator);
this.status = AwaiterStatus.Pending;
this.cancellationToken = cancellationToken;
this.continuation = null;
TaskTracker.TrackActiveTask(this, 2);
}
public bool IsCompleted => status.IsCompleted();
public AwaiterStatus Status => status;
public void GetResult()
{
switch (status)
{
case AwaiterStatus.Succeeded:
break;
case AwaiterStatus.Pending:
Error.ThrowNotYetCompleted();
break;
case AwaiterStatus.Faulted:
exception.Throw();
break;
case AwaiterStatus.Canceled:
Error.ThrowOperationCanceledException();
break;
default:
break;
}
}
public bool MoveNext()
{
if (cancellationToken.IsCancellationRequested)
{
InvokeContinuation(AwaiterStatus.Canceled);
return false;
}
var success = false;
try
{
if (innerEnumerator.MoveNext())
{
return true;
}
else
{
success = true;
}
}
catch (Exception ex)
{
exception = ExceptionDispatchInfo.Capture(ex);
}
InvokeContinuation(success ? AwaiterStatus.Succeeded : AwaiterStatus.Faulted);
return false;
}
void InvokeContinuation(AwaiterStatus status)
{
this.status = status;
var cont = this.continuation;
// cleanup
TaskTracker.RemoveTracking(this);
this.continuation = null;
this.cancellationToken = CancellationToken.None;
this.innerEnumerator = null;
if (cont != null) cont.Invoke();
}
public void OnCompleted(Action continuation)
{
UnsafeOnCompleted(continuation);
}
public void UnsafeOnCompleted(Action continuation)
{
Error.ThrowWhenContinuationIsAlreadyRegistered(this.continuation);
this.continuation = continuation;
}
// Unwrap YieldInstructions
static IEnumerator ConsumeEnumerator(IEnumerator enumerator)
{
while (enumerator.MoveNext())
{
var current = enumerator.Current;
if (current == null)
{
yield return null;
}
else if (current is CustomYieldInstruction)
{
// WWW, WaitForSecondsRealtime
var e2 = UnwrapWaitCustomYieldInstruction((CustomYieldInstruction)current);
while (e2.MoveNext())
{
yield return null;
}
}
else if (current is YieldInstruction)
{
IEnumerator innerCoroutine = null;
switch (current)
{
case AsyncOperation ao:
innerCoroutine = UnwrapWaitAsyncOperation(ao);
break;
case WaitForSeconds wfs:
innerCoroutine = UnwrapWaitForSeconds(wfs);
break;
}
if (innerCoroutine != null)
{
while (innerCoroutine.MoveNext())
{
yield return null;
}
}
else
{
yield return null;
}
}
else if (current is IEnumerator e3)
{
var e4 = ConsumeEnumerator(e3);
while (e4.MoveNext())
{
yield return null;
}
}
else
{
// WaitForEndOfFrame, WaitForFixedUpdate, others.
yield return null;
}
}
}
// WWW and others as CustomYieldInstruction.
static IEnumerator UnwrapWaitCustomYieldInstruction(CustomYieldInstruction yieldInstruction)
{
while (yieldInstruction.keepWaiting)
{
yield return null;
}
}
static readonly FieldInfo waitForSeconds_Seconds = typeof(WaitForSeconds).GetField("m_Seconds", BindingFlags.Instance | BindingFlags.GetField | BindingFlags.NonPublic);
static IEnumerator UnwrapWaitForSeconds(WaitForSeconds waitForSeconds)
{
var second = (float)waitForSeconds_Seconds.GetValue(waitForSeconds);
var startTime = DateTimeOffset.UtcNow;
while (true)
{
yield return null;
var elapsed = (DateTimeOffset.UtcNow - startTime).TotalSeconds;
if (elapsed >= second)
{
break;
}
};
}
static IEnumerator UnwrapWaitAsyncOperation(AsyncOperation asyncOperation)
{
while (!asyncOperation.isDone)
{
yield return null;
}
}
}
}
}
#endif

View File

@@ -1,64 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591
using System.Runtime.CompilerServices;
namespace UniRx.Async
{
public enum AwaiterStatus
{
/// <summary>The operation has not yet completed.</summary>
Pending = 0,
/// <summary>The operation completed successfully.</summary>
Succeeded = 1,
/// <summary>The operation completed with an error.</summary>
Faulted = 2,
/// <summary>The operation completed due to cancellation.</summary>
Canceled = 3
}
public interface IAwaiter : ICriticalNotifyCompletion
{
AwaiterStatus Status { get; }
bool IsCompleted { get; }
void GetResult();
}
public interface IAwaiter<out T> : IAwaiter
{
new T GetResult();
}
public static class AwaiterStatusExtensions
{
/// <summary>!= Pending.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsCompleted(this AwaiterStatus status)
{
return status != AwaiterStatus.Pending;
}
/// <summary>== Succeeded.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsCompletedSuccessfully(this AwaiterStatus status)
{
return status == AwaiterStatus.Succeeded;
}
/// <summary>== Canceled.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsCanceled(this AwaiterStatus status)
{
return status == AwaiterStatus.Canceled;
}
/// <summary>== Faulted.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsFaulted(this AwaiterStatus status)
{
return status == AwaiterStatus.Faulted;
}
}
}
#endif

View File

@@ -1,32 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Threading;
namespace UniRx.Async.Internal
{
internal static class CancellationTokenHelper
{
public static bool TrySetOrLinkCancellationToken(ref CancellationToken field, CancellationToken newCancellationToken)
{
if (newCancellationToken == CancellationToken.None)
{
return false;
}
else if (field == CancellationToken.None)
{
field = newCancellationToken;
return true;
}
else if (field == newCancellationToken)
{
return false;
}
field = CancellationTokenSource.CreateLinkedTokenSource(field, newCancellationToken).Token;
return true;
}
}
}
#endif

View File

@@ -1,23 +0,0 @@
#if NET_4_6 || NET_STANDARD_2_0 || CSHARP_7_OR_LATER
using System;
namespace UniRx.Async.Internal
{
internal static class FuncExtensions
{
// avoid lambda capture
internal static Action<T> AsFuncOfT<T>(this Action action)
{
return new Action<T>(action.Invoke);
}
static void Invoke<T>(this Action action, T unused)
{
action();
}
}
}
#endif

View File

@@ -1,130 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System;
using System.Threading;
namespace UniRx.Async.Internal
{
internal sealed class LazyPromise : IAwaiter
{
Func<UniTask> factory;
UniTask value;
public LazyPromise(Func<UniTask> factory)
{
this.factory = factory;
}
void Create()
{
var f = Interlocked.Exchange(ref factory, null);
if (f != null)
{
value = f();
}
}
public bool IsCompleted
{
get
{
Create();
return value.IsCompleted;
}
}
public AwaiterStatus Status
{
get
{
Create();
return value.Status;
}
}
public void GetResult()
{
Create();
value.GetResult();
}
void IAwaiter.GetResult()
{
GetResult();
}
public void UnsafeOnCompleted(Action continuation)
{
Create();
value.GetAwaiter().UnsafeOnCompleted(continuation);
}
public void OnCompleted(Action continuation)
{
UnsafeOnCompleted(continuation);
}
}
internal sealed class LazyPromise<T> : IAwaiter<T>
{
Func<UniTask<T>> factory;
UniTask<T> value;
public LazyPromise(Func<UniTask<T>> factory)
{
this.factory = factory;
}
void Create()
{
var f = Interlocked.Exchange(ref factory, null);
if (f != null)
{
value = f();
}
}
public bool IsCompleted
{
get
{
Create();
return value.IsCompleted;
}
}
public AwaiterStatus Status
{
get
{
Create();
return value.Status;
}
}
public T GetResult()
{
Create();
return value.Result;
}
void IAwaiter.GetResult()
{
GetResult();
}
public void UnsafeOnCompleted(Action continuation)
{
Create();
value.GetAwaiter().UnsafeOnCompleted(continuation);
}
public void OnCompleted(Action continuation)
{
UnsafeOnCompleted(continuation);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: fe7a4187b7f89f84582fd1e466a7f27e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,34 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
namespace UniRx.Async.Internal
{
internal static class PromiseHelper
{
internal static void TrySetResultAll<TPromise, T>(IEnumerable<TPromise> source, T value)
where TPromise : class, IResolvePromise<T>
{
var rentArray = ArrayPoolUtil.Materialize(source);
var clearArray = true;
try
{
var array = rentArray.Array;
var len = rentArray.Length;
for (int i = 0; i < len; i++)
{
array[i].TrySetResult(value);
array[i] = null;
}
clearArray = false;
}
finally
{
rentArray.DisposeManually(clearArray);
}
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 173f9b763911bf847b7dfbf31ee87fc4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,395 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System;
using System.Diagnostics;
using System.Runtime.ExceptionServices;
using System.Threading;
namespace UniRx.Async.Internal
{
// public for some types uses it.
public abstract class ReusablePromise : IAwaiter
{
ExceptionDispatchInfo exception;
object continuation; // Action or Queue<Action>
AwaiterStatus status;
public UniTask Task => new UniTask(this);
// can override for control 'start/reset' timing.
public virtual bool IsCompleted => status.IsCompleted();
public virtual void GetResult()
{
switch (status)
{
case AwaiterStatus.Succeeded:
return;
case AwaiterStatus.Faulted:
exception.Throw();
break;
case AwaiterStatus.Canceled:
throw new OperationCanceledException();
default:
break;
}
throw new InvalidOperationException("Invalid Status:" + status);
}
public AwaiterStatus Status => status;
void IAwaiter.GetResult()
{
GetResult();
}
public void ResetStatus(bool forceReset)
{
if (forceReset)
{
status = AwaiterStatus.Pending;
}
else if (status == AwaiterStatus.Succeeded)
{
status = AwaiterStatus.Pending;
}
}
public virtual bool TrySetCanceled()
{
if (status == AwaiterStatus.Pending)
{
status = AwaiterStatus.Canceled;
TryInvokeContinuation();
return true;
}
return false;
}
public virtual bool TrySetException(Exception ex)
{
if (status == AwaiterStatus.Pending)
{
status = AwaiterStatus.Faulted;
exception = ExceptionDispatchInfo.Capture(ex);
TryInvokeContinuation();
return true;
}
return false;
}
public virtual bool TrySetResult()
{
if (status == AwaiterStatus.Pending)
{
status = AwaiterStatus.Succeeded;
TryInvokeContinuation();
return true;
}
return false;
}
void TryInvokeContinuation()
{
if (continuation == null) return;
if (continuation is Action act)
{
continuation = null;
act();
}
else
{
// reuse Queue(don't null clear)
var q = (MinimumQueue<Action>)continuation;
var size = q.Count;
for (int i = 0; i < size; i++)
{
q.Dequeue().Invoke();
}
}
}
public void OnCompleted(Action action)
{
UnsafeOnCompleted(action);
}
public void UnsafeOnCompleted(Action action)
{
if (continuation == null)
{
continuation = action;
return;
}
else
{
if (continuation is Action act)
{
var q = new MinimumQueue<Action>(4);
q.Enqueue(act);
q.Enqueue(action);
continuation = q;
return;
}
else
{
((MinimumQueue<Action>)continuation).Enqueue(action);
}
}
}
}
public abstract class ReusablePromise<T> : IAwaiter<T>
{
T result;
ExceptionDispatchInfo exception;
object continuation; // Action or Queue<Action>
AwaiterStatus status;
public UniTask<T> Task => new UniTask<T>(this);
// can override for control 'start/reset' timing.
public virtual bool IsCompleted => status.IsCompleted();
protected T RawResult => result;
protected void ForceSetResult(T result)
{
this.result = result;
}
public virtual T GetResult()
{
switch (status)
{
case AwaiterStatus.Succeeded:
return result;
case AwaiterStatus.Faulted:
exception.Throw();
break;
case AwaiterStatus.Canceled:
throw new OperationCanceledException();
default:
break;
}
throw new InvalidOperationException("Invalid Status:" + status);
}
public AwaiterStatus Status => status;
void IAwaiter.GetResult()
{
GetResult();
}
public void ResetStatus(bool forceReset)
{
if (forceReset)
{
status = AwaiterStatus.Pending;
}
else if (status == AwaiterStatus.Succeeded)
{
status = AwaiterStatus.Pending;
}
}
public virtual bool TrySetCanceled()
{
if (status == AwaiterStatus.Pending)
{
status = AwaiterStatus.Canceled;
TryInvokeContinuation();
return true;
}
return false;
}
public virtual bool TrySetException(Exception ex)
{
if (status == AwaiterStatus.Pending)
{
status = AwaiterStatus.Faulted;
exception = ExceptionDispatchInfo.Capture(ex);
TryInvokeContinuation();
return true;
}
return false;
}
public virtual bool TrySetResult(T result)
{
if (status == AwaiterStatus.Pending)
{
status = AwaiterStatus.Succeeded;
this.result = result;
TryInvokeContinuation();
return true;
}
return false;
}
protected void TryInvokeContinuation()
{
if (continuation == null) return;
if (continuation is Action act)
{
continuation = null;
act();
}
else
{
// reuse Queue(don't null clear)
var q = (MinimumQueue<Action>)continuation;
var size = q.Count;
for (int i = 0; i < size; i++)
{
q.Dequeue().Invoke();
}
}
}
public void OnCompleted(Action action)
{
UnsafeOnCompleted(action);
}
public void UnsafeOnCompleted(Action action)
{
if (continuation == null)
{
continuation = action;
return;
}
else
{
if (continuation is Action act)
{
var q = new MinimumQueue<Action>(4);
q.Enqueue(act);
q.Enqueue(action);
continuation = q;
return;
}
else
{
((MinimumQueue<Action>)continuation).Enqueue(action);
}
}
}
}
public abstract class PlayerLoopReusablePromiseBase : ReusablePromise, IPlayerLoopItem
{
readonly PlayerLoopTiming timing;
protected readonly CancellationToken cancellationToken;
bool isRunning = false;
#if UNITY_EDITOR
string capturedStackTraceForDebugging;
#endif
public PlayerLoopReusablePromiseBase(PlayerLoopTiming timing, CancellationToken cancellationToken, int skipTrackFrameCountAdditive)
{
this.timing = timing;
this.cancellationToken = cancellationToken;
#if UNITY_EDITOR
this.capturedStackTraceForDebugging = TaskTracker.CaptureStackTrace(skipTrackFrameCountAdditive + 1); // 1 is self,
#endif
}
public override bool IsCompleted
{
get
{
if (Status == AwaiterStatus.Canceled || Status == AwaiterStatus.Faulted) return true;
if (!isRunning)
{
isRunning = true;
ResetStatus(false);
OnRunningStart();
#if UNITY_EDITOR
TaskTracker.TrackActiveTask(this, capturedStackTraceForDebugging);
#endif
PlayerLoopHelper.AddAction(timing, this);
}
return false;
}
}
protected abstract void OnRunningStart();
protected void Complete()
{
isRunning = false;
#if UNITY_EDITOR
TaskTracker.RemoveTracking(this);
#endif
}
public abstract bool MoveNext();
}
public abstract class PlayerLoopReusablePromiseBase<T> : ReusablePromise<T>, IPlayerLoopItem
{
readonly PlayerLoopTiming timing;
protected readonly CancellationToken cancellationToken;
bool isRunning = false;
#if UNITY_EDITOR
string capturedStackTraceForDebugging;
#endif
public PlayerLoopReusablePromiseBase(PlayerLoopTiming timing, CancellationToken cancellationToken, int skipTrackFrameCountAdditive)
{
this.timing = timing;
this.cancellationToken = cancellationToken;
#if UNITY_EDITOR
this.capturedStackTraceForDebugging = TaskTracker.CaptureStackTrace(skipTrackFrameCountAdditive + 1); // 1 is self,
#endif
}
public override bool IsCompleted
{
get
{
if (Status == AwaiterStatus.Canceled || Status == AwaiterStatus.Faulted) return true;
if (!isRunning)
{
isRunning = true;
ResetStatus(false);
OnRunningStart();
#if UNITY_EDITOR
TaskTracker.TrackActiveTask(this, capturedStackTraceForDebugging);
#endif
PlayerLoopHelper.AddAction(timing, this);
}
return false;
}
}
protected abstract void OnRunningStart();
protected void Complete()
{
isRunning = false;
#if UNITY_EDITOR
TaskTracker.RemoveTracking(this);
#endif
}
public abstract bool MoveNext();
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: a8cfc99b5928c0242919aac2121b02bb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,152 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
namespace UniRx.Async.Internal
{
// public for add user custom.
public static class TaskTracker
{
#if UNITY_EDITOR
static int trackingId = 0;
public const string EnableAutoReloadKey = "UniTaskTrackerWindow_EnableAutoReloadKey";
public const string EnableTrackingKey = "UniTaskTrackerWindow_EnableTrackingKey";
public const string EnableStackTraceKey = "UniTaskTrackerWindow_EnableStackTraceKey";
public static class EditorEnableState
{
static bool enableAutoReload;
public static bool EnableAutoReload
{
get { return enableAutoReload; }
set
{
enableAutoReload = value;
UnityEditor.EditorPrefs.SetBool(EnableAutoReloadKey, value);
}
}
static bool enableTracking;
public static bool EnableTracking
{
get { return enableTracking; }
set
{
enableTracking = value;
UnityEditor.EditorPrefs.SetBool(EnableTrackingKey, value);
}
}
static bool enableStackTrace;
public static bool EnableStackTrace
{
get { return enableStackTrace; }
set
{
enableStackTrace = value;
UnityEditor.EditorPrefs.SetBool(EnableStackTraceKey, value);
}
}
}
#endif
static List<KeyValuePair<IAwaiter, (int trackingId, DateTime addTime, string stackTrace)>> listPool = new List<KeyValuePair<IAwaiter, (int trackingId, DateTime addTime, string stackTrace)>>();
static readonly WeakDictionary<IAwaiter, (int trackingId, DateTime addTime, string stackTrace)> tracking = new WeakDictionary<IAwaiter, (int trackingId, DateTime addTime, string stackTrace)>();
[Conditional("UNITY_EDITOR")]
public static void TrackActiveTask(IAwaiter task, int skipFrame = 1)
{
#if UNITY_EDITOR
dirty = true;
if (!EditorEnableState.EnableTracking) return;
var stackTrace = EditorEnableState.EnableStackTrace ? new StackTrace(skipFrame, true).CleanupAsyncStackTrace() : "";
tracking.TryAdd(task, (Interlocked.Increment(ref trackingId), DateTime.UtcNow, stackTrace));
#endif
}
[Conditional("UNITY_EDITOR")]
public static void TrackActiveTask(IAwaiter task, string stackTrace)
{
#if UNITY_EDITOR
dirty = true;
if (!EditorEnableState.EnableTracking) return;
var success = tracking.TryAdd(task, (Interlocked.Increment(ref trackingId), DateTime.UtcNow, stackTrace));
#endif
}
public static string CaptureStackTrace(int skipFrame)
{
#if UNITY_EDITOR
if (!EditorEnableState.EnableTracking) return "";
var stackTrace = EditorEnableState.EnableStackTrace ? new StackTrace(skipFrame + 1, true).CleanupAsyncStackTrace() : "";
return stackTrace;
#else
return null;
#endif
}
[Conditional("UNITY_EDITOR")]
public static void RemoveTracking(IAwaiter task)
{
#if UNITY_EDITOR
dirty = true;
if (!EditorEnableState.EnableTracking) return;
var success = tracking.TryRemove(task);
#endif
}
static bool dirty;
public static bool CheckAndResetDirty()
{
var current = dirty;
dirty = false;
return current;
}
/// <summary>(trackingId, awaiterType, awaiterStatus, createdTime, stackTrace)</summary>
public static void ForEachActiveTask(Action<int, string, AwaiterStatus, DateTime, string> action)
{
lock (listPool)
{
var count = tracking.ToList(ref listPool, clear: false);
try
{
for (int i = 0; i < count; i++)
{
string typeName = null;
var keyType = listPool[i].Key.GetType();
if (keyType.IsNested)
{
typeName = keyType.DeclaringType.Name + "." + keyType.Name;
}
else
{
typeName = keyType.Name;
}
action(listPool[i].Value.trackingId, typeName, listPool[i].Key.Status, listPool[i].Value.addTime, listPool[i].Value.stackTrace);
listPool[i] = new KeyValuePair<IAwaiter, (int trackingId, DateTime addTime, string stackTrace)>(null, (0, default(DateTime), null)); // clear
}
}
catch
{
listPool.Clear();
throw;
}
}
}
}
}
#endif

View File

@@ -1,192 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System;
using System.Linq;
using UnityEngine;
using UniRx.Async.Internal;
using System.Threading;
#if UNITY_2019_3_OR_NEWER
using UnityEngine.LowLevel;
#else
using UnityEngine.Experimental.LowLevel;
#endif
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace UniRx.Async
{
public static class UniTaskLoopRunners
{
public struct UniTaskLoopRunnerInitialization { };
public struct UniTaskLoopRunnerEarlyUpdate { };
public struct UniTaskLoopRunnerFixedUpdate { };
public struct UniTaskLoopRunnerPreUpdate { };
public struct UniTaskLoopRunnerUpdate { };
public struct UniTaskLoopRunnerPreLateUpdate { };
public struct UniTaskLoopRunnerPostLateUpdate { };
// Yield
public struct UniTaskLoopRunnerYieldInitialization { };
public struct UniTaskLoopRunnerYieldEarlyUpdate { };
public struct UniTaskLoopRunnerYieldFixedUpdate { };
public struct UniTaskLoopRunnerYieldPreUpdate { };
public struct UniTaskLoopRunnerYieldUpdate { };
public struct UniTaskLoopRunnerYieldPreLateUpdate { };
public struct UniTaskLoopRunnerYieldPostLateUpdate { };
}
public enum PlayerLoopTiming
{
Initialization = 0,
EarlyUpdate = 1,
FixedUpdate = 2,
PreUpdate = 3,
Update = 4,
PreLateUpdate = 5,
PostLateUpdate = 6
}
public interface IPlayerLoopItem
{
bool MoveNext();
}
public static class PlayerLoopHelper
{
public static SynchronizationContext UnitySynchronizationContext => unitySynchronizationContetext;
public static int MainThreadId => mainThreadId;
static int mainThreadId;
static SynchronizationContext unitySynchronizationContetext;
static ContinuationQueue[] yielders;
static PlayerLoopRunner[] runners;
static PlayerLoopSystem[] InsertRunner(PlayerLoopSystem loopSystem, Type loopRunnerYieldType,
ContinuationQueue cq, Type loopRunnerType, PlayerLoopRunner runner)
{
#if UNITY_EDITOR
EditorApplication.playModeStateChanged += (state) =>
{
if (state == PlayModeStateChange.EnteredEditMode ||
state == PlayModeStateChange.EnteredPlayMode) return;
if (runner != null)
runner.Clear();
if (cq != null)
cq.Clear();
};
#endif
var yieldLoop = new PlayerLoopSystem
{
type = loopRunnerYieldType,
updateDelegate = cq.Run
};
var runnerLoop = new PlayerLoopSystem
{
type = loopRunnerType,
updateDelegate = runner.Run
};
var source = loopSystem.subSystemList // Remove items from previous initializations.
.Where(ls => ls.type != loopRunnerYieldType && ls.type != loopRunnerType).ToArray();
var dest = new PlayerLoopSystem[source.Length + 2];
Array.Copy(source, 0, dest, 2, source.Length);
dest[0] = yieldLoop;
dest[1] = runnerLoop;
return dest;
}
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void Init()
{
// capture default(unity) sync-context.
unitySynchronizationContetext = SynchronizationContext.Current;
mainThreadId = Thread.CurrentThread.ManagedThreadId;
#if UNITY_EDITOR && UNITY_2019_3_OR_NEWER
// When domain reload is disabled, re-initialization is required when entering play mode;
// otherwise, pending tasks will leak between play mode sessions.
var domainReloadDisabled = UnityEditor.EditorSettings.enterPlayModeOptionsEnabled &&
UnityEditor.EditorSettings.enterPlayModeOptions.HasFlag(UnityEditor.EnterPlayModeOptions.DisableDomainReload);
if (!domainReloadDisabled && runners != null) return;
#else
if (runners != null) return; // already initialized
#endif
var playerLoop =
#if UNITY_2019_3_OR_NEWER
PlayerLoop.GetCurrentPlayerLoop();
#else
PlayerLoop.GetDefaultPlayerLoop();
#endif
Initialize(ref playerLoop);
}
#if UNITY_EDITOR
[InitializeOnLoadMethod]
static void InitOnEditor()
{
//Execute the play mode init method
Init();
//register an Editor update delegate, used to forcing playerLoop update
EditorApplication.update += ForceEditorPlayerLoopUpdate;
}
private static void ForceEditorPlayerLoopUpdate()
{
if (EditorApplication.isPlayingOrWillChangePlaymode || EditorApplication.isCompiling ||
EditorApplication.isUpdating)
{
// Not in Edit mode, don't interfere
return;
}
//force unity to update PlayerLoop callbacks
EditorApplication.QueuePlayerLoopUpdate();
}
#endif
public static void Initialize(ref PlayerLoopSystem playerLoop)
{
yielders = new ContinuationQueue[7];
runners = new PlayerLoopRunner[7];
var copyList = playerLoop.subSystemList.ToArray();
copyList[0].subSystemList = InsertRunner(copyList[0], typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldInitialization), yielders[0] = new ContinuationQueue(), typeof(UniTaskLoopRunners.UniTaskLoopRunnerInitialization), runners[0] = new PlayerLoopRunner());
copyList[1].subSystemList = InsertRunner(copyList[1], typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldEarlyUpdate), yielders[1] = new ContinuationQueue(), typeof(UniTaskLoopRunners.UniTaskLoopRunnerEarlyUpdate), runners[1] = new PlayerLoopRunner());
copyList[2].subSystemList = InsertRunner(copyList[2], typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldFixedUpdate), yielders[2] = new ContinuationQueue(), typeof(UniTaskLoopRunners.UniTaskLoopRunnerFixedUpdate), runners[2] = new PlayerLoopRunner());
copyList[3].subSystemList = InsertRunner(copyList[3], typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldPreUpdate), yielders[3] = new ContinuationQueue(), typeof(UniTaskLoopRunners.UniTaskLoopRunnerPreUpdate), runners[3] = new PlayerLoopRunner());
copyList[4].subSystemList = InsertRunner(copyList[4], typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldUpdate), yielders[4] = new ContinuationQueue(), typeof(UniTaskLoopRunners.UniTaskLoopRunnerUpdate), runners[4] = new PlayerLoopRunner());
copyList[5].subSystemList = InsertRunner(copyList[5], typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldPreLateUpdate), yielders[5] = new ContinuationQueue(), typeof(UniTaskLoopRunners.UniTaskLoopRunnerPreLateUpdate), runners[5] = new PlayerLoopRunner());
copyList[6].subSystemList = InsertRunner(copyList[6], typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldPostLateUpdate), yielders[6] = new ContinuationQueue(), typeof(UniTaskLoopRunners.UniTaskLoopRunnerPostLateUpdate), runners[6] = new PlayerLoopRunner());
playerLoop.subSystemList = copyList;
PlayerLoop.SetPlayerLoop(playerLoop);
}
public static void AddAction(PlayerLoopTiming timing, IPlayerLoopItem action)
{
runners[(int)timing].AddAction(action);
}
public static void AddContinuation(PlayerLoopTiming timing, Action continuation)
{
yielders[(int)timing].Enqueue(continuation);
}
}
}
#endif

View File

@@ -1,54 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncAnimatorTrigger : AsyncTriggerBase
{
AsyncTriggerPromise<int> onAnimatorIK;
AsyncTriggerPromiseDictionary<int> onAnimatorIKs;
AsyncTriggerPromise<AsyncUnit> onAnimatorMove;
AsyncTriggerPromiseDictionary<AsyncUnit> onAnimatorMoves;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onAnimatorIK, onAnimatorIKs, onAnimatorMove, onAnimatorMoves);
}
void OnAnimatorIK(int layerIndex)
{
TrySetResult(onAnimatorIK, onAnimatorIKs, layerIndex);
}
public UniTask<int> OnAnimatorIKAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onAnimatorIK, ref onAnimatorIKs, cancellationToken);
}
void OnAnimatorMove()
{
TrySetResult(onAnimatorMove, onAnimatorMoves, AsyncUnit.Default);
}
public UniTask OnAnimatorMoveAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onAnimatorMove, ref onAnimatorMoves, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: ae912c37ac7f4cd42b25f22452435103
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,55 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using UnityEngine;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncAwakeTrigger : MonoBehaviour
{
bool called = false;
UniTaskCompletionSource promise;
void Awake()
{
called = true;
promise?.TrySetResult();
}
public UniTask AwakeAsync()
{
if (called) return UniTask.CompletedTask;
PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, new AwakeMonitor(this));
return new UniTask(promise ?? (promise = new UniTaskCompletionSource()));
}
private void OnDestroy()
{
promise?.TrySetCanceled();
}
class AwakeMonitor : IPlayerLoopItem
{
readonly AsyncAwakeTrigger trigger;
public AwakeMonitor(AsyncAwakeTrigger trigger)
{
this.trigger = trigger;
}
public bool MoveNext()
{
if (trigger.called) return false;
if (trigger == null)
{
trigger.OnDestroy();
return false;
}
return true;
}
}
}
}
#endif

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncBeginDragTrigger : AsyncTriggerBase, IBeginDragHandler
{
AsyncTriggerPromise<PointerEventData> onBeginDrag;
AsyncTriggerPromiseDictionary<PointerEventData> onBeginDrags;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onBeginDrag, onBeginDrags);
}
void IBeginDragHandler.OnBeginDrag(PointerEventData eventData)
{
TrySetResult(onBeginDrag, onBeginDrags, eventData);
}
public UniTask<PointerEventData> OnBeginDragAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onBeginDrag, ref onBeginDrags, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 171fd2191eb22af4fbd92b51815ca757
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncCancelTrigger : AsyncTriggerBase, ICancelHandler
{
AsyncTriggerPromise<BaseEventData> onCancel;
AsyncTriggerPromiseDictionary<BaseEventData> onCancels;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onCancel, onCancels);
}
void ICancelHandler.OnCancel(BaseEventData eventData)
{
TrySetResult(onCancel, onCancels, eventData);
}
public UniTask<BaseEventData> OnCancelAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onCancel, ref onCancels, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 291886b6e5f2d044a85b2a4dedcaca97
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncCanvasGroupChangedTrigger : AsyncTriggerBase
{
AsyncTriggerPromise<AsyncUnit> onCanvasGroupChanged;
AsyncTriggerPromiseDictionary<AsyncUnit> onCanvasGroupChangeds;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onCanvasGroupChanged, onCanvasGroupChangeds);
}
void OnCanvasGroupChanged()
{
TrySetResult(onCanvasGroupChanged, onCanvasGroupChangeds, AsyncUnit.Default);
}
public UniTask OnCanvasGroupChangedAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onCanvasGroupChanged, ref onCanvasGroupChangeds, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: eddba832648f83046a320ffcacfc771d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,69 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncCollision2DTrigger : AsyncTriggerBase
{
AsyncTriggerPromise<Collision2D> onCollisionEnter2D;
AsyncTriggerPromiseDictionary<Collision2D> onCollisionEnter2Ds;
AsyncTriggerPromise<Collision2D> onCollisionExit2D;
AsyncTriggerPromiseDictionary<Collision2D> onCollisionExit2Ds;
AsyncTriggerPromise<Collision2D> onCollisionStay2D;
AsyncTriggerPromiseDictionary<Collision2D> onCollisionStay2Ds;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onCollisionEnter2D, onCollisionEnter2Ds, onCollisionExit2D, onCollisionExit2Ds, onCollisionStay2D, onCollisionStay2Ds);
}
void OnCollisionEnter2D(Collision2D coll)
{
TrySetResult(onCollisionEnter2D, onCollisionEnter2Ds, coll);
}
public UniTask<Collision2D> OnCollisionEnter2DAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onCollisionEnter2D, ref onCollisionEnter2Ds, cancellationToken);
}
void OnCollisionExit2D(Collision2D coll)
{
TrySetResult(onCollisionExit2D, onCollisionExit2Ds, coll);
}
public UniTask<Collision2D> OnCollisionExit2DAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onCollisionExit2D, ref onCollisionExit2Ds, cancellationToken);
}
void OnCollisionStay2D(Collision2D coll)
{
TrySetResult(onCollisionStay2D, onCollisionStay2Ds, coll);
}
public UniTask<Collision2D> OnCollisionStay2DAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onCollisionStay2D, ref onCollisionStay2Ds, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: fbeb63f69bedec44f8003730887f914b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,69 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncCollisionTrigger : AsyncTriggerBase
{
AsyncTriggerPromise<Collision> onCollisionEnter;
AsyncTriggerPromiseDictionary<Collision> onCollisionEnters;
AsyncTriggerPromise<Collision> onCollisionExit;
AsyncTriggerPromiseDictionary<Collision> onCollisionExits;
AsyncTriggerPromise<Collision> onCollisionStay;
AsyncTriggerPromiseDictionary<Collision> onCollisionStays;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onCollisionEnter, onCollisionEnters, onCollisionExit, onCollisionExits, onCollisionStay, onCollisionStays);
}
void OnCollisionEnter(Collision collision)
{
TrySetResult(onCollisionEnter, onCollisionEnters, collision);
}
public UniTask<Collision> OnCollisionEnterAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onCollisionEnter, ref onCollisionEnters, cancellationToken);
}
void OnCollisionExit(Collision collisionInfo)
{
TrySetResult(onCollisionExit, onCollisionExits, collisionInfo);
}
public UniTask<Collision> OnCollisionExitAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onCollisionExit, ref onCollisionExits, cancellationToken);
}
void OnCollisionStay(Collision collisionInfo)
{
TrySetResult(onCollisionStay, onCollisionStays, collisionInfo);
}
public UniTask<Collision> OnCollisionStayAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onCollisionStay, ref onCollisionStays, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 72db4a683be8f6a428823502599014a9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncDeselectTrigger : AsyncTriggerBase, IDeselectHandler
{
AsyncTriggerPromise<BaseEventData> onDeselect;
AsyncTriggerPromiseDictionary<BaseEventData> onDeselects;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onDeselect, onDeselects);
}
void IDeselectHandler.OnDeselect(BaseEventData eventData)
{
TrySetResult(onDeselect, onDeselects, eventData);
}
public UniTask<BaseEventData> OnDeselectAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onDeselect, ref onDeselects, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 30faa9be5bd883e488bdc52f4825c4da
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,93 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Threading;
using UniRx.Async.Internal;
using UnityEngine;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncDestroyTrigger : MonoBehaviour
{
bool called = false;
UniTaskCompletionSource promise;
CancellationTokenSource cancellationTokenSource; // main cancellation
object canellationTokenSourceOrQueue; // external from AddCancellationTriggerOnDestroy
public CancellationToken CancellationToken
{
get
{
if (cancellationTokenSource == null)
{
cancellationTokenSource = new CancellationTokenSource();
}
return cancellationTokenSource.Token;
}
}
/// <summary>This function is called when the MonoBehaviour will be destroyed.</summary>
void OnDestroy()
{
called = true;
promise?.TrySetResult();
cancellationTokenSource?.Cancel();
cancellationTokenSource?.Dispose();
if (canellationTokenSourceOrQueue != null)
{
if (canellationTokenSourceOrQueue is CancellationTokenSource cts)
{
cts.Cancel();
cts.Dispose();
}
else
{
var q = (MinimumQueue<CancellationTokenSource>)canellationTokenSourceOrQueue;
while (q.Count != 0)
{
var c = q.Dequeue();
c.Cancel();
c.Dispose();
}
}
canellationTokenSourceOrQueue = null;
}
}
/// <summary>This function is called when the MonoBehaviour will be destroyed.</summary>
public UniTask OnDestroyAsync()
{
if (called) return UniTask.CompletedTask;
return new UniTask(promise ?? (promise = new UniTaskCompletionSource()));
}
/// <summary>Add Cancellation Triggers on destroy</summary>
public void AddCancellationTriggerOnDestroy(CancellationTokenSource cts)
{
if (called)
{
cts.Cancel();
cts.Dispose();
}
if (canellationTokenSourceOrQueue == null)
{
canellationTokenSourceOrQueue = cts;
}
else if (canellationTokenSourceOrQueue is CancellationTokenSource c)
{
var q = new MinimumQueue<CancellationTokenSource>(4);
q.Enqueue(c);
q.Enqueue(cts);
canellationTokenSourceOrQueue = q;
}
else
{
((MinimumQueue<CancellationTokenSource>)canellationTokenSourceOrQueue).Enqueue(cts);
}
}
}
}
#endif

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncDragTrigger : AsyncTriggerBase, IDragHandler
{
AsyncTriggerPromise<PointerEventData> onDrag;
AsyncTriggerPromiseDictionary<PointerEventData> onDrags;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onDrag, onDrags);
}
void IDragHandler.OnDrag(PointerEventData eventData)
{
TrySetResult(onDrag, onDrags, eventData);
}
public UniTask<PointerEventData> OnDragAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onDrag, ref onDrags, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 52242547ba60ea74f8a2e3bbab5fcdfa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncDropTrigger : AsyncTriggerBase, IDropHandler
{
AsyncTriggerPromise<PointerEventData> onDrop;
AsyncTriggerPromiseDictionary<PointerEventData> onDrops;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onDrop, onDrops);
}
void IDropHandler.OnDrop(PointerEventData eventData)
{
TrySetResult(onDrop, onDrops, eventData);
}
public UniTask<PointerEventData> OnDropAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onDrop, ref onDrops, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 42d65fd5e4be25f41a927eca25b0acf7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,55 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncEnableDisableTrigger : AsyncTriggerBase
{
AsyncTriggerPromise<AsyncUnit> onEnable;
AsyncTriggerPromiseDictionary<AsyncUnit> onEnables;
AsyncTriggerPromise<AsyncUnit> onDisable;
AsyncTriggerPromiseDictionary<AsyncUnit> onDisables;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onEnable, onEnables, onDisable, onDisables);
}
void OnEnable()
{
TrySetResult(onEnable, onEnables, AsyncUnit.Default);
}
public UniTask OnEnableAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onEnable, ref onEnables, cancellationToken);
}
void OnDisable()
{
TrySetResult(onDisable, onDisables, AsyncUnit.Default);
}
public UniTask OnDisableAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onDisable, ref onDisables, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: d0bf9142b63b4cb43b693f0b83b3dbe7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncEndDragTrigger : AsyncTriggerBase, IEndDragHandler
{
AsyncTriggerPromise<PointerEventData> onEndDrag;
AsyncTriggerPromiseDictionary<PointerEventData> onEndDrags;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onEndDrag, onEndDrags);
}
void IEndDragHandler.OnEndDrag(PointerEventData eventData)
{
TrySetResult(onEndDrag, onEndDrags, eventData);
}
public UniTask<PointerEventData> OnEndDragAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onEndDrag, ref onEndDrags, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 8298d43de348acc4aa4e7dbf30472dbf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,264 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncEventTrigger : AsyncTriggerBase
{
AsyncTriggerPromise<BaseEventData> onDeselect;
AsyncTriggerPromiseDictionary<BaseEventData> onDeselects;
AsyncTriggerPromise<AxisEventData> onMove;
AsyncTriggerPromiseDictionary<AxisEventData> onMoves;
AsyncTriggerPromise<PointerEventData> onPointerDown;
AsyncTriggerPromiseDictionary<PointerEventData> onPointerDowns;
AsyncTriggerPromise<PointerEventData> onPointerEnter;
AsyncTriggerPromiseDictionary<PointerEventData> onPointerEnters;
AsyncTriggerPromise<PointerEventData> onPointerExit;
AsyncTriggerPromiseDictionary<PointerEventData> onPointerExits;
AsyncTriggerPromise<PointerEventData> onPointerUp;
AsyncTriggerPromiseDictionary<PointerEventData> onPointerUps;
AsyncTriggerPromise<BaseEventData> onSelect;
AsyncTriggerPromiseDictionary<BaseEventData> onSelects;
AsyncTriggerPromise<PointerEventData> onPointerClick;
AsyncTriggerPromiseDictionary<PointerEventData> onPointerClicks;
AsyncTriggerPromise<BaseEventData> onSubmit;
AsyncTriggerPromiseDictionary<BaseEventData> onSubmits;
AsyncTriggerPromise<PointerEventData> onDrag;
AsyncTriggerPromiseDictionary<PointerEventData> onDrags;
AsyncTriggerPromise<PointerEventData> onBeginDrag;
AsyncTriggerPromiseDictionary<PointerEventData> onBeginDrags;
AsyncTriggerPromise<PointerEventData> onEndDrag;
AsyncTriggerPromiseDictionary<PointerEventData> onEndDrags;
AsyncTriggerPromise<PointerEventData> onDrop;
AsyncTriggerPromiseDictionary<PointerEventData> onDrops;
AsyncTriggerPromise<BaseEventData> onUpdateSelected;
AsyncTriggerPromiseDictionary<BaseEventData> onUpdateSelecteds;
AsyncTriggerPromise<PointerEventData> onInitializePotentialDrag;
AsyncTriggerPromiseDictionary<PointerEventData> onInitializePotentialDrags;
AsyncTriggerPromise<BaseEventData> onCancel;
AsyncTriggerPromiseDictionary<BaseEventData> onCancels;
AsyncTriggerPromise<PointerEventData> onScroll;
AsyncTriggerPromiseDictionary<PointerEventData> onScrolls;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onDeselect, onDeselects, onMove, onMoves, onPointerDown, onPointerDowns, onPointerEnter, onPointerEnters, onPointerExit, onPointerExits, onPointerUp, onPointerUps, onSelect, onSelects, onPointerClick, onPointerClicks, onSubmit, onSubmits, onDrag, onDrags, onBeginDrag, onBeginDrags, onEndDrag, onEndDrags, onDrop, onDrops, onUpdateSelected, onUpdateSelecteds, onInitializePotentialDrag, onInitializePotentialDrags, onCancel, onCancels, onScroll, onScrolls);
}
void OnDeselect(BaseEventData eventData)
{
TrySetResult(onDeselect, onDeselects, eventData);
}
public UniTask<BaseEventData> OnDeselectAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onDeselect, ref onDeselects, cancellationToken);
}
void OnMove(AxisEventData eventData)
{
TrySetResult(onMove, onMoves, eventData);
}
public UniTask<AxisEventData> OnMoveAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onMove, ref onMoves, cancellationToken);
}
void OnPointerDown(PointerEventData eventData)
{
TrySetResult(onPointerDown, onPointerDowns, eventData);
}
public UniTask<PointerEventData> OnPointerDownAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onPointerDown, ref onPointerDowns, cancellationToken);
}
void OnPointerEnter(PointerEventData eventData)
{
TrySetResult(onPointerEnter, onPointerEnters, eventData);
}
public UniTask<PointerEventData> OnPointerEnterAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onPointerEnter, ref onPointerEnters, cancellationToken);
}
void OnPointerExit(PointerEventData eventData)
{
TrySetResult(onPointerExit, onPointerExits, eventData);
}
public UniTask<PointerEventData> OnPointerExitAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onPointerExit, ref onPointerExits, cancellationToken);
}
void OnPointerUp(PointerEventData eventData)
{
TrySetResult(onPointerUp, onPointerUps, eventData);
}
public UniTask<PointerEventData> OnPointerUpAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onPointerUp, ref onPointerUps, cancellationToken);
}
void OnSelect(BaseEventData eventData)
{
TrySetResult(onSelect, onSelects, eventData);
}
public UniTask<BaseEventData> OnSelectAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onSelect, ref onSelects, cancellationToken);
}
void OnPointerClick(PointerEventData eventData)
{
TrySetResult(onPointerClick, onPointerClicks, eventData);
}
public UniTask<PointerEventData> OnPointerClickAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onPointerClick, ref onPointerClicks, cancellationToken);
}
void OnSubmit(BaseEventData eventData)
{
TrySetResult(onSubmit, onSubmits, eventData);
}
public UniTask<BaseEventData> OnSubmitAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onSubmit, ref onSubmits, cancellationToken);
}
void OnDrag(PointerEventData eventData)
{
TrySetResult(onDrag, onDrags, eventData);
}
public UniTask<PointerEventData> OnDragAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onDrag, ref onDrags, cancellationToken);
}
void OnBeginDrag(PointerEventData eventData)
{
TrySetResult(onBeginDrag, onBeginDrags, eventData);
}
public UniTask<PointerEventData> OnBeginDragAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onBeginDrag, ref onBeginDrags, cancellationToken);
}
void OnEndDrag(PointerEventData eventData)
{
TrySetResult(onEndDrag, onEndDrags, eventData);
}
public UniTask<PointerEventData> OnEndDragAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onEndDrag, ref onEndDrags, cancellationToken);
}
void OnDrop(PointerEventData eventData)
{
TrySetResult(onDrop, onDrops, eventData);
}
public UniTask<PointerEventData> OnDropAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onDrop, ref onDrops, cancellationToken);
}
void OnUpdateSelected(BaseEventData eventData)
{
TrySetResult(onUpdateSelected, onUpdateSelecteds, eventData);
}
public UniTask<BaseEventData> OnUpdateSelectedAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onUpdateSelected, ref onUpdateSelecteds, cancellationToken);
}
void OnInitializePotentialDrag(PointerEventData eventData)
{
TrySetResult(onInitializePotentialDrag, onInitializePotentialDrags, eventData);
}
public UniTask<PointerEventData> OnInitializePotentialDragAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onInitializePotentialDrag, ref onInitializePotentialDrags, cancellationToken);
}
void OnCancel(BaseEventData eventData)
{
TrySetResult(onCancel, onCancels, eventData);
}
public UniTask<BaseEventData> OnCancelAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onCancel, ref onCancels, cancellationToken);
}
void OnScroll(PointerEventData eventData)
{
TrySetResult(onScroll, onScrolls, eventData);
}
public UniTask<PointerEventData> OnScrollAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onScroll, ref onScrolls, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 89997820797ad6d43b17971a8bd0d8fe
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncFixedUpdateTrigger : AsyncTriggerBase
{
AsyncTriggerPromise<AsyncUnit> fixedUpdate;
AsyncTriggerPromiseDictionary<AsyncUnit> fixedUpdates;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(fixedUpdate, fixedUpdates);
}
void FixedUpdate()
{
TrySetResult(fixedUpdate, fixedUpdates, AsyncUnit.Default);
}
public UniTask FixedUpdateAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref fixedUpdate, ref fixedUpdates, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: c74b906c4294aaa4e900f6e7f8b36df6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncInitializePotentialDragTrigger : AsyncTriggerBase, IInitializePotentialDragHandler
{
AsyncTriggerPromise<PointerEventData> onInitializePotentialDrag;
AsyncTriggerPromiseDictionary<PointerEventData> onInitializePotentialDrags;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onInitializePotentialDrag, onInitializePotentialDrags);
}
void IInitializePotentialDragHandler.OnInitializePotentialDrag(PointerEventData eventData)
{
TrySetResult(onInitializePotentialDrag, onInitializePotentialDrags, eventData);
}
public UniTask<PointerEventData> OnInitializePotentialDragAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onInitializePotentialDrag, ref onInitializePotentialDrags, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: ae0733adc239a324f8b934ffb119abd8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,55 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncJointTrigger : AsyncTriggerBase
{
AsyncTriggerPromise<float> onJointBreak;
AsyncTriggerPromiseDictionary<float> onJointBreaks;
AsyncTriggerPromise<Joint2D> onJointBreak2D;
AsyncTriggerPromiseDictionary<Joint2D> onJointBreak2Ds;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onJointBreak, onJointBreaks, onJointBreak2D, onJointBreak2Ds);
}
void OnJointBreak(float breakForce)
{
TrySetResult(onJointBreak, onJointBreaks, breakForce);
}
public UniTask<float> OnJointBreakAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onJointBreak, ref onJointBreaks, cancellationToken);
}
void OnJointBreak2D(Joint2D brokenJoint)
{
TrySetResult(onJointBreak2D, onJointBreak2Ds, brokenJoint);
}
public UniTask<Joint2D> OnJointBreak2DAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onJointBreak2D, ref onJointBreak2Ds, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 04dc74e7b2368094f9153921804a1fb7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncLateUpdateTrigger : AsyncTriggerBase
{
AsyncTriggerPromise<AsyncUnit> lateUpdate;
AsyncTriggerPromiseDictionary<AsyncUnit> lateUpdates;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(lateUpdate, lateUpdates);
}
void LateUpdate()
{
TrySetResult(lateUpdate, lateUpdates, AsyncUnit.Default);
}
public UniTask LateUpdateAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref lateUpdate, ref lateUpdates, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: a4fb2b4c09cb4ec4a82b934f2038eb36
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,129 +0,0 @@
#if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO)
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncMouseTrigger : AsyncTriggerBase
{
AsyncTriggerPromise<AsyncUnit> onMouseDown;
AsyncTriggerPromiseDictionary<AsyncUnit> onMouseDowns;
AsyncTriggerPromise<AsyncUnit> onMouseDrag;
AsyncTriggerPromiseDictionary<AsyncUnit> onMouseDrags;
AsyncTriggerPromise<AsyncUnit> onMouseEnter;
AsyncTriggerPromiseDictionary<AsyncUnit> onMouseEnters;
AsyncTriggerPromise<AsyncUnit> onMouseExit;
AsyncTriggerPromiseDictionary<AsyncUnit> onMouseExits;
AsyncTriggerPromise<AsyncUnit> onMouseOver;
AsyncTriggerPromiseDictionary<AsyncUnit> onMouseOvers;
AsyncTriggerPromise<AsyncUnit> onMouseUp;
AsyncTriggerPromiseDictionary<AsyncUnit> onMouseUps;
AsyncTriggerPromise<AsyncUnit> onMouseUpAsButton;
AsyncTriggerPromiseDictionary<AsyncUnit> onMouseUpAsButtons;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onMouseDown, onMouseDowns, onMouseDrag, onMouseDrags, onMouseEnter, onMouseEnters, onMouseExit, onMouseExits, onMouseOver, onMouseOvers, onMouseUp, onMouseUps, onMouseUpAsButton, onMouseUpAsButtons);
}
void OnMouseDown()
{
TrySetResult(onMouseDown, onMouseDowns, AsyncUnit.Default);
}
public UniTask OnMouseDownAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onMouseDown, ref onMouseDowns, cancellationToken);
}
void OnMouseDrag()
{
TrySetResult(onMouseDrag, onMouseDrags, AsyncUnit.Default);
}
public UniTask OnMouseDragAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onMouseDrag, ref onMouseDrags, cancellationToken);
}
void OnMouseEnter()
{
TrySetResult(onMouseEnter, onMouseEnters, AsyncUnit.Default);
}
public UniTask OnMouseEnterAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onMouseEnter, ref onMouseEnters, cancellationToken);
}
void OnMouseExit()
{
TrySetResult(onMouseExit, onMouseExits, AsyncUnit.Default);
}
public UniTask OnMouseExitAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onMouseExit, ref onMouseExits, cancellationToken);
}
void OnMouseOver()
{
TrySetResult(onMouseOver, onMouseOvers, AsyncUnit.Default);
}
public UniTask OnMouseOverAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onMouseOver, ref onMouseOvers, cancellationToken);
}
void OnMouseUp()
{
TrySetResult(onMouseUp, onMouseUps, AsyncUnit.Default);
}
public UniTask OnMouseUpAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onMouseUp, ref onMouseUps, cancellationToken);
}
void OnMouseUpAsButton()
{
TrySetResult(onMouseUpAsButton, onMouseUpAsButtons, AsyncUnit.Default);
}
public UniTask OnMouseUpAsButtonAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onMouseUpAsButton, ref onMouseUpAsButtons, cancellationToken);
}
}
}
#endif
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 57ad5120e9c4d424484c963791467272
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncMoveTrigger : AsyncTriggerBase, IMoveHandler
{
AsyncTriggerPromise<AxisEventData> onMove;
AsyncTriggerPromiseDictionary<AxisEventData> onMoves;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onMove, onMoves);
}
void IMoveHandler.OnMove(AxisEventData eventData)
{
TrySetResult(onMove, onMoves, eventData);
}
public UniTask<AxisEventData> OnMoveAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onMove, ref onMoves, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 1699926e875c24d4aa34bc8817f96f0e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncParticleTrigger : AsyncTriggerBase
{
AsyncTriggerPromise<GameObject> onParticleCollision;
AsyncTriggerPromiseDictionary<GameObject> onParticleCollisions;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onParticleCollision, onParticleCollisions);
}
void OnParticleCollision(GameObject other)
{
TrySetResult(onParticleCollision, onParticleCollisions, other);
}
public UniTask<GameObject> OnParticleCollisionAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onParticleCollision, ref onParticleCollisions, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 27d3f2efd47fb1d4fb2e9130f97ea8aa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncPointerClickTrigger : AsyncTriggerBase, IPointerClickHandler
{
AsyncTriggerPromise<PointerEventData> onPointerClick;
AsyncTriggerPromiseDictionary<PointerEventData> onPointerClicks;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onPointerClick, onPointerClicks);
}
void IPointerClickHandler.OnPointerClick(PointerEventData eventData)
{
TrySetResult(onPointerClick, onPointerClicks, eventData);
}
public UniTask<PointerEventData> OnPointerClickAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onPointerClick, ref onPointerClicks, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 9f8865abf2db3d248b3730cdb18bb8b7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncPointerDownTrigger : AsyncTriggerBase, IPointerDownHandler
{
AsyncTriggerPromise<PointerEventData> onPointerDown;
AsyncTriggerPromiseDictionary<PointerEventData> onPointerDowns;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onPointerDown, onPointerDowns);
}
void IPointerDownHandler.OnPointerDown(PointerEventData eventData)
{
TrySetResult(onPointerDown, onPointerDowns, eventData);
}
public UniTask<PointerEventData> OnPointerDownAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onPointerDown, ref onPointerDowns, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 7c5132395605eaa498a7efedee5acdd7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncPointerEnterTrigger : AsyncTriggerBase, IPointerEnterHandler
{
AsyncTriggerPromise<PointerEventData> onPointerEnter;
AsyncTriggerPromiseDictionary<PointerEventData> onPointerEnters;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onPointerEnter, onPointerEnters);
}
void IPointerEnterHandler.OnPointerEnter(PointerEventData eventData)
{
TrySetResult(onPointerEnter, onPointerEnters, eventData);
}
public UniTask<PointerEventData> OnPointerEnterAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onPointerEnter, ref onPointerEnters, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 18887d476d48533498efd14224a2f651
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncPointerExitTrigger : AsyncTriggerBase, IPointerExitHandler
{
AsyncTriggerPromise<PointerEventData> onPointerExit;
AsyncTriggerPromiseDictionary<PointerEventData> onPointerExits;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onPointerExit, onPointerExits);
}
void IPointerExitHandler.OnPointerExit(PointerEventData eventData)
{
TrySetResult(onPointerExit, onPointerExits, eventData);
}
public UniTask<PointerEventData> OnPointerExitAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onPointerExit, ref onPointerExits, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 9e3ed09876a11a84794795809ebee243
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncPointerUpTrigger : AsyncTriggerBase, IPointerUpHandler
{
AsyncTriggerPromise<PointerEventData> onPointerUp;
AsyncTriggerPromiseDictionary<PointerEventData> onPointerUps;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onPointerUp, onPointerUps);
}
void IPointerUpHandler.OnPointerUp(PointerEventData eventData)
{
TrySetResult(onPointerUp, onPointerUps, eventData);
}
public UniTask<PointerEventData> OnPointerUpAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onPointerUp, ref onPointerUps, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 7a0493ea32f81314cbbaf2b635ba3167
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,55 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncRectTransformTrigger : AsyncTriggerBase
{
AsyncTriggerPromise<AsyncUnit> onRectTransformDimensionsChange;
AsyncTriggerPromiseDictionary<AsyncUnit> onRectTransformDimensionsChanges;
AsyncTriggerPromise<AsyncUnit> onRectTransformRemoved;
AsyncTriggerPromiseDictionary<AsyncUnit> onRectTransformRemoveds;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onRectTransformDimensionsChange, onRectTransformDimensionsChanges, onRectTransformRemoved, onRectTransformRemoveds);
}
void OnRectTransformDimensionsChange()
{
TrySetResult(onRectTransformDimensionsChange, onRectTransformDimensionsChanges, AsyncUnit.Default);
}
public UniTask OnRectTransformDimensionsChangeAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onRectTransformDimensionsChange, ref onRectTransformDimensionsChanges, cancellationToken);
}
void OnRectTransformRemoved()
{
TrySetResult(onRectTransformRemoved, onRectTransformRemoveds, AsyncUnit.Default);
}
public UniTask OnRectTransformRemovedAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onRectTransformRemoved, ref onRectTransformRemoveds, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: dfe3470221c66c84397c0783c62b24e7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncScrollTrigger : AsyncTriggerBase, IScrollHandler
{
AsyncTriggerPromise<PointerEventData> onScroll;
AsyncTriggerPromiseDictionary<PointerEventData> onScrolls;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onScroll, onScrolls);
}
void IScrollHandler.OnScroll(PointerEventData eventData)
{
TrySetResult(onScroll, onScrolls, eventData);
}
public UniTask<PointerEventData> OnScrollAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onScroll, ref onScrolls, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 7c751e9d3deb97d4d8691a8a583c2afd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncSelectTrigger : AsyncTriggerBase, ISelectHandler
{
AsyncTriggerPromise<BaseEventData> onSelect;
AsyncTriggerPromiseDictionary<BaseEventData> onSelects;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onSelect, onSelects);
}
void ISelectHandler.OnSelect(BaseEventData eventData)
{
TrySetResult(onSelect, onSelects, eventData);
}
public UniTask<BaseEventData> OnSelectAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onSelect, ref onSelects, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: fcc2347251a4fc5498a03f0c17382920
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,64 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using UnityEngine;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncStartTrigger : MonoBehaviour
{
bool awakeCalled = false;
bool called = false;
UniTaskCompletionSource promise;
void Awake()
{
awakeCalled = true;
}
void Start()
{
called = true;
promise?.TrySetResult();
}
public UniTask StartAsync()
{
if (called) return UniTask.CompletedTask;
if (!awakeCalled)
{
PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, new AwakeMonitor(this));
}
return new UniTask(promise ?? (promise = new UniTaskCompletionSource()));
}
private void OnDestroy()
{
promise?.TrySetCanceled();
}
class AwakeMonitor : IPlayerLoopItem
{
readonly AsyncStartTrigger trigger;
public AwakeMonitor(AsyncStartTrigger trigger)
{
this.trigger = trigger;
}
public bool MoveNext()
{
if (trigger.awakeCalled) return false;
if (trigger == null)
{
trigger.OnDestroy();
return false;
}
return true;
}
}
}
}
#endif

View File

@@ -1,41 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncSubmitTrigger : AsyncTriggerBase, ISubmitHandler
{
AsyncTriggerPromise<BaseEventData> onSubmit;
AsyncTriggerPromiseDictionary<BaseEventData> onSubmits;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onSubmit, onSubmits);
}
void ISubmitHandler.OnSubmit(BaseEventData eventData)
{
TrySetResult(onSubmit, onSubmits, eventData);
}
public UniTask<BaseEventData> OnSubmitAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onSubmit, ref onSubmits, cancellationToken);
}
}
}
#endif

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 97e85abc2d7ec0c44adfbe5ee971aad3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,69 +0,0 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UniRx.Async.Triggers
{
[DisallowMultipleComponent]
public class AsyncTransformChangedTrigger : AsyncTriggerBase
{
AsyncTriggerPromise<AsyncUnit> onBeforeTransformParentChanged;
AsyncTriggerPromiseDictionary<AsyncUnit> onBeforeTransformParentChangeds;
AsyncTriggerPromise<AsyncUnit> onTransformParentChanged;
AsyncTriggerPromiseDictionary<AsyncUnit> onTransformParentChangeds;
AsyncTriggerPromise<AsyncUnit> onTransformChildrenChanged;
AsyncTriggerPromiseDictionary<AsyncUnit> onTransformChildrenChangeds;
protected override IEnumerable<ICancelablePromise> GetPromises()
{
return Concat(onBeforeTransformParentChanged, onBeforeTransformParentChangeds, onTransformParentChanged, onTransformParentChangeds, onTransformChildrenChanged, onTransformChildrenChangeds);
}
void OnBeforeTransformParentChanged()
{
TrySetResult(onBeforeTransformParentChanged, onBeforeTransformParentChangeds, AsyncUnit.Default);
}
public UniTask OnBeforeTransformParentChangedAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onBeforeTransformParentChanged, ref onBeforeTransformParentChangeds, cancellationToken);
}
void OnTransformParentChanged()
{
TrySetResult(onTransformParentChanged, onTransformParentChangeds, AsyncUnit.Default);
}
public UniTask OnTransformParentChangedAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onTransformParentChanged, ref onTransformParentChangeds, cancellationToken);
}
void OnTransformChildrenChanged()
{
TrySetResult(onTransformChildrenChanged, onTransformChildrenChangeds, AsyncUnit.Default);
}
public UniTask OnTransformChildrenChangedAsync(CancellationToken cancellationToken = default(CancellationToken))
{
return GetOrAddPromise(ref onTransformChildrenChanged, ref onTransformChildrenChangeds, cancellationToken);
}
}
}
#endif

Some files were not shown because too many files have changed in this diff Show More