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); }
public void ShowAlmost(int coins) { PopUpsController pUP = ShowPopUp(AlmostPrefab); AlmostWindowController awc = pUP.GetComponent <AlmostWindowController>(); awc.SetCoins(coins); }
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); }