using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks.Linq; using PMaker.Await; using System; using System.Linq; using System.Threading; using UniRx; using UniRx.Toolkit; using UnityEngine; public class UITestLogic : AwaitBehaviour { public AwaitBehaviour[] logics; public UIMultimodule multimodule; private void Reset() { this.logics = GetComponentsInChildren(true); this.multimodule = GetComponentInChildren(true); } public override async UniTask WaitAsync(CancellationToken cancellationToken = default) { multimodule.gameObject.SetActive(true); var logics = this.logics.Select(_ => { var func = new Func(async token => { await _.WaitAsync(token); }); return func; }); await multimodule.WaitAsync(logics.ToArray(), cancellationToken); Debug.Log("Over!"); } }