Frame/Assets/Scripts/UI/Logic/GameSceneResultUI.cs

34 lines
815 B
C#
Raw Normal View History

2024-04-09 18:16:37 +08:00
using System.Threading;
using Cysharp.Threading.Tasks;
using UnityEngine.UI;
namespace Game;
[UIType(UIType.GameSceneResultUI)]
public class GameSceneResultUI : UIBase
{
private Image img_Lose;
private Image img_Success;
public override void Init()
{
base.Init();
this.img_Lose = this.self.transform.FindChildDeep<Image>("img_Lose");
this.img_Success = this.self.transform.FindChildDeep<Image>("img_Success");
}
public override void Dispose()
{
base.Dispose();
}
public async UniTask WaitShowAndCloseResultAsync(bool isTrue, CancellationToken token)
{
img_Success.gameObject.SetActive(isTrue);
this.img_Lose.gameObject.SetActive(!isTrue);
await UniTask.Delay(4000);
Game.uiManager.CloseLast();
}
}