using System.Threading; using Cysharp.Threading.Tasks; using TMPro; using UnityEngine.UI; namespace Game; [UIType(UIType.GameSceneResultUI)] public class GameSceneResultUI : UIBase { private Image img_Lose; private Image img_Success; private TMP_Text txt_LoseContent; private TMP_Text txt_SuccessContent; public override void Init() { base.Init(); this.img_Lose = this.self.transform.FindChildDeep("img_Lose"); this.img_Success = this.self.transform.FindChildDeep("img_Success"); this.txt_LoseContent = this.self.transform.FindChildDeep("txt_LoseContent"); this.txt_SuccessContent = this.self.transform.FindChildDeep("txt_SuccessContent"); } public override void Dispose() { base.Dispose(); } public async UniTask WaitShowAndCloseResultAsync(CancellationToken token) { await UniTask.Delay(4000); Game.uiManager.CloseLast(); } public void SetResult(string str, bool isSuccess) { img_Success.gameObject.SetActive(isSuccess); this.img_Lose.gameObject.SetActive(!isSuccess); this.txt_SuccessContent.text = str; this.txt_LoseContent.text = str; } }