HintLogPanel.cs 608 B

123456789101112131415161718192021222324252627282930
  1. using QFramework;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class HintLogPanel : MonoSingleton<HintLogPanel>
  7. {
  8. public GameObject hintPanel;
  9. public Text hintLog;
  10. public void Show(string hint)
  11. {
  12. hintLog.text = hint;
  13. hintPanel.SetActive(true);
  14. StartCoroutine(TimeClose(1));
  15. }
  16. public void Close()
  17. {
  18. hintLog.text = "";
  19. hintPanel.SetActive(false);
  20. }
  21. IEnumerator TimeClose( float times)
  22. {
  23. yield return new WaitForSeconds(times);
  24. Close();
  25. }
  26. }