using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using ZXKFramework; namespace DongWuYiXue.DaoNiaoShu { public class GuidePanel : UIBase { public override string GroupName => "GuidePanel"; public override string Name => "GuidePanel"; Text guide; List str = new(); Coroutine coroutine; public override void Init(IUIManager uictrl) { base.Init(uictrl); guide = transform.FindFirst("guideText"); } public void ShowGuide(string txt) { if (string.IsNullOrEmpty(txt)) return; guide.text = txt; SetActive(true); } public override void Show() { base.Show(); if (coroutine != null) { StopCoroutine(coroutine); coroutine = null; } coroutine = StartCoroutine(Close()); } public override void Hide() { base.Hide(); if(coroutine != null) StopCoroutine(coroutine); } IEnumerator Close() { yield return new WaitForSeconds(8f); SetActive(false); } } }