Пример #1
0
        void onClick(GameObject e)
        {
            switch (e.name)
            {
            case "plusWorkerBtn":
                if (DbManager.Instance.GetPlusWorkerNum() < DbManager.Instance.GetMaxPlusWorkerNum())
                {
                    ConfirmCtrl.Show(string.Format("花费¥3 购买10个家丁({0}/{1})\n(家丁越多资源生产效率越高)\n确定购买?", DbManager.Instance.GetPlusWorkerNum(), DbManager.Instance.GetMaxPlusWorkerNum()), () => {
                        MaiHandler.PayForProduct("com.courage2017.worker_10");
//                            DbManager.Instance.SetPlusWorkerNum(DbManager.Instance.GetPlusWorkerNum() + 10);
//                            DbManager.Instance.SetMaxWorkerNum(DbManager.Instance.GetMaxWorkerNum() + 10);
//                            DbManager.Instance.SetWorkerNum(DbManager.Instance.GetWorkerNum() + 10);
//                            WorkshopPanelCtrl.MakeWorkerNumChange(DbManager.Instance.GetWorkerNum(), DbManager.Instance.GetMaxWorkerNum());
//                            AlertCtrl.Show("成功招募了10个家丁");
                    }, null, "购买", "不了");
                }
                else
                {
                    AlertCtrl.Show(string.Format("你已经买满了{0}个家丁", DbManager.Instance.GetMaxPlusWorkerNum()));
                }
                break;

            case "CloseBtn":
                FadeOut();
                break;

            default:
                break;
            }
        }
Пример #2
0
        void onClick(GameObject e)
        {
            if (!PayBtn.enabled)
            {
                return;
            }
            if (!IsFree)
            {
                MaiHandler.PayForProduct(ProductId);
            }
            else
            {
//                MaiHandler.StartRewardedVideo(() => {
                DbManager.Instance.GotSilver(1000);
                Messenger.Broadcast <string>(NotifyTypes.GetStorePanelData, UserModel.CurrentUserData.CurrentCitySceneId);
                StartTimer();
                AlertCtrl.Show("银子 +1000");
//                });
            }
        }
Пример #3
0
        void onClick(GameObject e)
        {
            if (!PayBtn.enabled)
            {
                return;
            }
            if (propData.Num >= propData.Max)
            {
                switch (propData.Type)
                {
                case PropType.NocturnalClothing:
                    AlertCtrl.Show(string.Format("最多只能携带{0}件夜行衣", propData.Max));
                    break;

                case PropType.Bodyguard:
                    AlertCtrl.Show(string.Format("最多只能雇佣{0}位镖师", propData.Max));
                    break;

                case PropType.LimePowder:
                    AlertCtrl.Show(string.Format("最多只能携带{0}包石灰粉", propData.Max));
                    break;

                case PropType.Scout:
                    AlertCtrl.Show(string.Format("最多只能拥有{0}个探子", propData.Max));
                    break;

                default:
                    break;
                }
                return;
            }

            if (!IsFree)
            {
                if (propData.Num > 0)
                {
                    switch (propData.Type)
                    {
                    case PropType.NocturnalClothing:
                        AlertCtrl.Show(string.Format("你还有{0}件夜行衣,不可再买", propData.Num));
                        break;

                    case PropType.Bodyguard:
                        AlertCtrl.Show(string.Format("你还有{0}位镖师,不可再买", propData.Num));
                        break;

                    case PropType.LimePowder:
                        AlertCtrl.Show(string.Format("你还有{0}包石灰粉,不可再买", propData.Num));
                        break;

                    case PropType.Scout:
                        AlertCtrl.Show(string.Format("你还有{0}个探子,不可再买", propData.Num));
                        break;

                    default:
                        break;
                    }
                    return;
                }
                MaiHandler.PayForProduct(productId);
            }
            else
            {
//                MaiHandler.StartRewardedVideo(() => {
                StartTimer();
                SendRewards(propData.Type, UnityEngine.Random.Range(1, 3));
//                });
            }
        }