using UnityEngine; using System.Collections; using System; public class MessageCodeCap : MonoBehaviour { public UILabel LabelMessage; public UIButton CloseButton; void Start() { GetComponent().Hide(); CloseButton.onClick.Add(new EventDelegate(OnClose)); StartCoroutine(AlphaActive()); } public IEnumerator AlphaActive() { yield return new WaitForSeconds(1f); GetComponent().alpha = 1; } private void OnClose() { GetComponent().Hide(); } }