using UnityEngine; using System.Collections; public class GenericUINotification : MonoBehaviour { ScreenBase screen; UILabel label; void Awake() { label = GetComponentInChildren(); screen = GetComponent(); //Debug.Log("AddListener"); NotificationCenter.AddListener(OnShowGenericNotification, NotificationType.ShowGenericNotification); } void OnDestroy() { NotificationCenter.RemoveListener(OnShowGenericNotification, NotificationType.ShowGenericNotification); } public void OnShowGenericNotification(Notification note) { Debug.Log("OnShowGenericNotification"); label.text = (string)note.data; screen.Show(); screen.Invoke("Hide", 3); } }