forked from zxl/LaboratoryProtection
21 lines
600 B
C#
21 lines
600 B
C#
using Cysharp.Threading.Tasks;
|
|
|
|
using System.Threading;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
namespace PMaker.Await.UI
|
|
{
|
|
public class UIDefaultAll : AwaitBehaviour
|
|
{
|
|
public override async UniTask WaitAsync(CancellationToken cancellationToken = default)
|
|
{
|
|
this.SetFalse();
|
|
var btns = this.transform.GetComponentsInChildren<Button>(true).Select(_ => _.OnClickAsync(cancellationToken));
|
|
this.gameObject.SetActive(true);
|
|
await UniTask.WhenAll(btns).SuppressCancellationThrow();
|
|
this.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
}
|