34 lines
750 B
C#
34 lines
750 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class UI_MiddleTipPanel : BasePanel
|
|
{
|
|
/// <summary>
|
|
/// 面板显示后几秒后消失
|
|
/// </summary>
|
|
private float disappear = 5f;
|
|
/// <summary>
|
|
/// 初始化
|
|
/// </summary>
|
|
public void Init(string content)
|
|
{
|
|
GetControl<TextMeshProUGUI>("Text_Content").text = content;
|
|
Hide();
|
|
}
|
|
/// <summary>
|
|
/// 面板消失
|
|
/// </summary>
|
|
private void Hide()
|
|
{
|
|
StartCoroutine(HideAsync());
|
|
}
|
|
private IEnumerator HideAsync()
|
|
{
|
|
yield return new WaitForSeconds(disappear);
|
|
UIManager.Instance.HidePanel<UI_MiddleTipPanel>();
|
|
}
|
|
}
|