49 lines
1.3 KiB
C#
Raw Normal View History

2025-09-08 14:51:28 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using ZXKFramework;
namespace YiLiao.JingMaiLiuZhiZhen
{
public class GuidePanel : UIBase
{
public override string GroupName => "GuidePanel";
public override string Name => "GuidePanel";
Text guide;
List<string> str = new();
Coroutine coroutine;
public override void Init(IUIManager uictrl)
{
base.Init(uictrl);
guide = transform.FindFirst<Text>("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);
}
}
}