MessageCodeCap.cs 580 B

12345678910111213141516171819202122232425262728
  1. using UnityEngine;
  2. using System.Collections;
  3. using System;
  4. public class MessageCodeCap : MonoBehaviour
  5. {
  6. public UILabel LabelMessage;
  7. public UIButton CloseButton;
  8. void Start()
  9. {
  10. GetComponent<ScreenBase>().Hide();
  11. CloseButton.onClick.Add(new EventDelegate(OnClose));
  12. StartCoroutine(AlphaActive());
  13. }
  14. public IEnumerator AlphaActive()
  15. {
  16. yield return new WaitForSeconds(1f);
  17. GetComponent<UIPanel>().alpha = 1;
  18. }
  19. private void OnClose()
  20. {
  21. GetComponent<ScreenBase>().Hide();
  22. }
  23. }