private void Awake() { instance = this; // UI Objects canvas = transform.GetChild(0).gameObject; obj_notification = canvas.transform.GetChild(1).gameObject; obj_title = obj_notification.transform.GetChild(0).gameObject; obj_description = obj_notification.transform.GetChild(1).gameObject; obj_button_container = obj_notification.transform.GetChild(2).gameObject; // UI Layouts for 1, 2, or 3 Buttons obj_button_layouts = new GameObject[obj_button_container.transform.childCount]; for (int i = 0; i < obj_button_layouts.Length; i++) { obj_button_layouts[i] = obj_button_container.transform.GetChild(i).gameObject; } // UI Text Components title = obj_title.GetComponent <Text>(); description = obj_description.GetComponent <Text>(); }
// Hide the notification ui public static void Close() { NotificationUIBehavior.Close(); }
// Send Notification to UI public static void Notify(Notification notification) { NotificationUIBehavior.Display(notification); }