// Use this for initialization void Awake() { Instance = this; responseHandler += DefaultResponseHandler; DeactivateUINotifications(this.transform); // notifications }
private void ProcessAdditiveUIStateRequests() { UIManagerAdditive uim = UIManagerAdditive.Instance; if (Input.GetKeyDown(KeyCode.Keypad0)) //BUSy needs rotating sprite { //AppStateController.Instance.animator.Play("Alert3", 1, 0f); //UIManagerAdditive.responseHandler -= UIManagerAdditive.Instance.DefaultResponseHandler; // unload the default //UIManagerAdditive.responseHandler += ResponseHandler; //UIManagerAdditive.Instance.ShowNotification(eNotificationType.Busy, eNotificationType.Busy.ToString(), "A busy test message"); // needs a callback for each button //DoozyUI.UIManager.ShowNotification("Busy", -1, false, "Busy", "A test message with informative info"); // works simple DoozyUI.UIManager.ShowNotification("Busy", -1, false, "Busy", "Click inside Inspector to EXIT ", uim.NotificationCallbackCancel); //simple cancel callback } if (Input.GetKeyDown(KeyCode.Keypad1)) // single button - info { DoozyUI.UIManager.ShowNotification("SingleButton", -1, false, "Single Button Info", "A test message with informative info", null, new string[] { "OKHit" }, new string[] { "OK" }, new UnityAction[] { uim.NotificationCallbackOk }); } //if (Input.GetKeyDown(KeyCode.Keypad4)) // single button - info // not escaping but think I can do it with a big button or pursue further //{ // DoozyUI.UIManager.ShowNotification("SingleButtonEsc", -1, false, "Single Button ESCAPABLE Info", "A test message with informative info", // null, // new string[] { "OKHit" }, // new string[] { "OK" }, // new UnityAction[] { uim.NotificationCallbackOk }); // new UnityAction[] { uim.NotificationCallbackOk } //} if (Input.GetKeyDown(KeyCode.Keypad2)) { UnityAction[] callbacks = { uim.NotificationCallbackOk, uim.NotificationCallbackCancel }; DoozyUI.UIManager.ShowNotification("Choice2Way", -1, false, "Choice 2-Way(bi)", "A test message with informative info", uim.notificationSprite, new string[] { "OKHit", "CancelHit" }, // broadcast game event name new string[] { "OK", "Cancel" }, // titles that appear callbacks); } if (Input.GetKeyDown(KeyCode.Keypad3)) { UnityAction[] callbacks = { uim.NotificationCallbackOk, uim.NotificationCallbackCancel, uim.NotificationCallbackRetry }; DoozyUI.UIManager.ShowNotification("Choice3Way", -1, false, "Choice 3-Way", "A test message with informative info", uim.notificationSprite, new string[] { "OKHit", "CancelHit", "RetryHit" }, // is associated with broadcast game event that gets published new string[] { "OK", "Cancel", "Retry" }, // title callbacks); } //ToggleViewVisibility(state); }