using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Rokid.MRC { public class UITipsPanel : UIPanelBase { private Text txtDesc; public float time = 1; public override void OnInit() { base.OnInit(); txtDesc = transform.Find("TxtLoading").GetComponent(); } public void SetDesc(string desc) { gameObject.SetActive(true); txtDesc.text = desc; UIManager.Instance.StartCoroutine(WaitAndClose()); } IEnumerator WaitAndClose() { yield return new WaitForSeconds(time); gameObject.SetActive(false); } } }