Пример #1
0
        public void ShowAdsPopup(string title, string message, string btn, Action actConfirm = null, Action actEixt = null)
        {
            PopupConfirm temp = PopupConfirm.Open("Prefabs/Popup/ADPopup", "AD", title, message + "\n" + "(After 10 ads, 200 coins will be paid.)", btn);

            temp.GetComponent <PopupAD>().SetInfo();

            temp.onConfirm += () =>
            {
                if (actConfirm != null)
                {
                    actConfirm();
                    actConfirm = null;
                }
                temp.Close();
                AdsMgr.G.ShowRewardedAd();
            };

            temp.onExit += () =>
            {
                if (actEixt != null)
                {
                    actEixt();
                    actEixt = null;
                }
                temp.Close();
            };
        }
Пример #2
0
        public void ShowItemPopup(string id, string title, string message, string btn, BoosterType type, int itemCount, int cost, Action actConfirm = null)
        {
            PopupConfirm temp      = PopupConfirm.Open("Prefabs/Popup/ItemPopup", id, title, message, btn, false);
            PopupItem    popupItem = temp.GetComponent <PopupItem>();

            if (popupItem != null)
            {
                popupItem.ItemSetting(type, itemCount, cost);
            }

            temp.onConfirm += () =>
            {
                if (actConfirm != null)
                {
                    actConfirm();
                    actConfirm = null;
                }

                temp.SetMessage("Purchase completed!");
                if (popupItem != null)
                {
                    popupItem.UpdateData(false);
                }

                temp.onConfirm += () =>
                {
                    temp.Close();
                };
            };
        }
Пример #3
0
        public void OnPressed()
        {
            SoundMgr.G.EffectPlay(System.EffectSound.btn_ok);

            if (popup == null)
            {
                oldDepth             = uiSettingPanel.depth;
                uiSettingPanel.depth = 5;
                ActiveBlack(true);

                popup         = PopupInGameSetting.Open("In Game Setting");
                popup.onQuit += () =>
                {
                    PopupConfirm temp = PopupConfirm.Open("Prefabs/Popup/ExitGamePopup", "Exit Popup", null, null, "QUIT");
                    temp.onConfirm += () =>
                    {
                        temp.Close();
                        GameMgr.G.Failed();
                    };

                    uiSettingPanel.depth = oldDepth;
                    ActiveBlack(false);
                };
            }
            else
            {
                popup.OnExit();
                uiSettingPanel.depth = oldDepth;
                ActiveBlack(false);
            }
        }
Пример #4
0
        public void OnPressed()
        {
            if(popup == null)
            {
                oldDepth = uiSettingPanel.depth;
                uiSettingPanel.depth = 5;
                uiBlack.SetActive(true);

                popup = PopupInGameSetting.Open("In Game Setting");
                popup.onQuit += () =>
                {
                    PopupConfirm temp = PopupConfirm.Open("Prefabs/Popup/ExitGamePopup", "Exit Popup", null, null, "Quit");
                    temp.onEixt += () =>
                    {
                        temp.Close();
                        GameMgr.G.Failed();
                    };

                    uiSettingPanel.depth = oldDepth;
                    uiBlack.SetActive(false);
                };

                popup.onBGM += () =>
                {

                };

                popup.onEffect += () =>
                {

                };
            }
            else
            {
                popup.OnExit();
                uiSettingPanel.depth = oldDepth;
                uiBlack.SetActive(false);
            }
        }