private WarningMessController CreateMessage(PopUpsController prefab, string caption, string message, Action yesCallBack, Action cancelCallBack, Action noCallBack) { PopUpsController p = CreateWindow(prefab, transform); WarningMessController pUp = p.GetComponent <WarningMessController>(); pUp.SetControlActivity(false); pUp.PopUpInit(new Action <PopUpsController>(PopUpOpenEventHandler), (g) => { PopUpCloseEventHandler(g); switch (pUp.Answer) { case MessageAnswer.Yes: yesCallBack?.Invoke(); break; case MessageAnswer.Cancel: cancelCallBack?.Invoke(); break; case MessageAnswer.No: noCallBack?.Invoke(); break; } }); pUp.SetMessage(caption, message, yesCallBack != null, cancelCallBack != null, noCallBack != null); p.ShowWindow(); return(pUp); }
private PopUpsController ShowPopup(GameObject popup_prefab, Transform parent, Vector3 position, Action openCallBack, Action closeCallBack) { if (!popup_prefab) { return(null); } PopUpsController pUp = CreateWindow(popup_prefab, parent, position); if (pUp) { pUp.PopUpInit( (g) => { PopUpOpenH(g); if (openCallBack != null) { openCallBack(); } }, (g) => { PopUpCloseH(g); if (closeCallBack != null) { closeCallBack(); } }); pUp.ShowWindow(); } return(pUp); }
protected PopUpsController ShowPopUp(PopUpsController popup_prefab, Transform parent, Action openCallBack, Action closeCallBack) { if (!popup_prefab) { return(null); } PopUpsController pUp = CreateWindow(popup_prefab, parent); if (pUp) { pUp.PopUpInit( (g) => { PopUpOpenEventHandler(g); openCallBack?.Invoke(); }, (g) => { PopUpCloseEventHandler(g); closeCallBack?.Invoke(); }); pUp.ShowWindow(); } return(pUp); }
private WarningMessController CreateMessage(GameObject prefab, string caption, string message, Action yesCallBack, Action cancelCallBack, Action noCallBack) { PopUpsController p = CreateWindow(prefab, popup.transform); WarningMessController pUp = p.GetComponent <WarningMessController>(); pUp.SetControlActivity(false); pUp.PopUpInit(new Action <GameObject>(PopUpOpenH), (g) => { PopUpCloseH(g); switch (pUp.Answer) { case MessageAnswer.Yes: if (yesCallBack != null) { yesCallBack(); } break; case MessageAnswer.Cancel: if (cancelCallBack != null) { cancelCallBack(); } break; case MessageAnswer.No: if (noCallBack != null) { noCallBack(); } break; } }); pUp.SetMessage(caption, message, yesCallBack != null, cancelCallBack != null, noCallBack != null); p.ShowWindow(); return(pUp); }