Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        private IEnumerator ShowMessageC(string caption, string message, float showTime, Action completeCallBack)
        {
            WarningMessController pUp = CreateMessage(MessageWindowPrefab, caption, message, null, null, null);

            yield return(new WaitForSeconds(showTime));

            completeCallBack?.Invoke();
            if (pUp)
            {
                pUp.CloseWindow();     // check if popup exist
            }
        }
Ejemplo n.º 3
0
        private IEnumerator ShowMessageC(string caption, string message, float showTime, Action completeCallBack)
        {
            WarningMessController pUp = CreateMessage(MessageWindowPrefab, caption, message, null, null, null);

            yield return(new WaitForSeconds(showTime));

            if (completeCallBack != null)
            {
                completeCallBack();
            }
            pUp.CloseWindow();
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Show message without buttons, auto closing
 /// </summary>
 /// <param name="caption"></param>
 /// <param name="message"></param>
 /// <param name="showTime"></param>
 /// <param name="completeCallBack"></param>
 public void ShowMessage(WarningMessController prefab, string caption, string message, float showTime, Action completeCallBack)
 {
     StartCoroutine(ShowMessageC(prefab, caption, message, showTime, completeCallBack));
 }
Ejemplo n.º 6
0
 public void ShowMessageWithYesNoCloseButton(WarningMessController prefab, string caption, string message, Action yesCallBack, Action cancelCallBack, Action noCallBack)
 {
     WarningMessController wMC = CreateMessage(prefab, caption, message, yesCallBack, cancelCallBack, noCallBack);
 }
Ejemplo n.º 7
0
        internal void ShowMessageTimeLeft(string caption, string message, float showTime)
        {
            WarningMessController pUp = CreateMessage(TimeLeftPrefab, caption, message, null, null, null);

            SimpleTween.Value(pUp.gameObject, 0, 1, showTime).AddCompleteCallBack(() => { pUp.CloseWindow(); });
        }
Ejemplo n.º 8
0
 internal void ShowMessageAbout(string caption, string message, Action yesCallBack, Action cancelCallBack, Action noCallBack)
 {
     WarningMessController wMC = CreateMessage(AboutPrefab, caption, message, yesCallBack, cancelCallBack, noCallBack);
 }
Ejemplo n.º 9
0
 internal void ShowMessageWithYesNoCloseButton(string caption, string message, Action yesCallBack, Action cancelCallBack, Action noCallBack)
 {
     WarningMessController wMC = CreateMessage(MessageWindowPrefab, caption, message, yesCallBack, cancelCallBack, noCallBack);
 }