Beispiel #1
0
    public void Submit(DialogView dialogView, DialogBean dialogBean)
    {
        InputTextDialogView inputTextDialog = dialogView as InputTextDialogView;

        AudioHandler.Instance.PlaySound(AudioSoundEnum.Reward);
        RewardTypeBean rewardTypeData = new RewardTypeBean();

        rewardTypeData.dataType = RewardTypeEnum.AddChild;
        rewardTypeData.data     = inputTextDialog.GetText();
        miniGameData.listReward.Add(rewardTypeData);
        base.EndGame(MiniGameResultEnum.Win, false);
    }
Beispiel #2
0
    public void Submit(DialogView dialogView, DialogBean dialogBean)
    {
        GameDataBean gameData = GameDataHandler.Instance.manager.GetGameData();

        if (dialogView is PickForCharacterDialogView)
        {
            buildBedData.GetResearchPrice(out long researchPriceL, out long researchPriceM, out long researchPriceS);
            //先判断一下是否有钱支付
            if (!gameData.HasEnoughMoney(researchPriceL, researchPriceM, researchPriceS))
            {
                ToastHandler.Instance.ToastHint(TextHandler.Instance.manager.GetTextById(1005));
                return;
            }
            //扣除金钱
            gameData.PayMoney(researchPriceL, researchPriceM, researchPriceS);
            //角色选择
            PickForCharacterDialogView pickForCharacterDialog = dialogView as PickForCharacterDialogView;
            List <CharacterBean>       listPickCharacter      = pickForCharacterDialog.GetPickCharacter();
            if (!CheckUtil.ListIsNull(listPickCharacter))
            {
                //开始研究
                buildBedData.StartResearch(listPickCharacter);
                string toastStr = string.Format(TextHandler.Instance.manager.GetTextById(1201), listPickCharacter[0].baseInfo.name, buildBedData.bedName);
                ToastHandler.Instance.ToastHint(toastStr);
            }
        }
        else if (dialogView is InputTextDialogView)
        {
            InputTextDialogView inputTextDialog = dialogView as InputTextDialogView;
            string bedName = inputTextDialog.GetText();
            if (!CheckUtil.StringIsNull(bedName))
            {
                buildBedData.bedName = bedName;
            }
        }
        else
        {
            if (dialogBean.dialogPosition == 1)
            {
                if (buildBedData.GetBedStatus() == ResearchStatusEnum.Researching)
                {
                    ToastHandler.Instance.ToastHint(TextHandler.Instance.manager.GetTextById(1313));
                    return;
                }
                if (buildBedData.isSet)
                {
                    ToastHandler.Instance.ToastHint(TextHandler.Instance.manager.GetTextById(1314));
                    return;
                }
                //丢弃确认
                gameData.RemoveBed(buildBedData);
                uiComponent.RefreshUI();
            }
            else if (dialogBean.dialogPosition == 2)
            {
                //普通弹窗(取消研究)
                buildBedData.CancelResearch(gameData);
            }
        }
        //重新设置数据
        if (gameObject)
        {
            SetData(buildBedData);
        }
    }