Ejemplo n.º 1
0
    public override void Execute()
    {
        var summonTable = SummonTableData.CreateFromJson();
        var summonData  = summonTable.GetSummonDataByLv(userInfoModel.summonLv);

        dispatcher.Dispatch(MediatorEvent.GetRecruitMoney, summonData.consume);
    }
Ejemplo n.º 2
0
    public override void Execute()
    {
        var summonLv = (int)evt.data;

        var summonTable = SummonTableData.CreateFromJson();
        var summonData  = summonTable.GetSummonDataByLv(summonLv);

        if (userInfoModel.money >= summonData.upgrade)
        {
            userInfoModel.money    -= summonData.upgrade;
            userInfoModel.summonLv += 1;
            userInfoService.SaveUserInfo(userInfoModel);

            dispatcher.Dispatch(MediatorEvent.UnlockSummonOver);
        }
        else
        {
            Debug.Log("钱不够");
        }
    }
Ejemplo n.º 3
0
    public override void Execute()
    {
        var summonLv    = (int)evt.data;
        var summonTable = SummonTableData.CreateFromJson();

        characterTable = CharacterTableData.CreateFromJson();
        summonData     = summonTable.GetSummonDataByLv(summonLv);

        if (userInfoModel.money >= summonData.consume)
        {
            // 扣除需要的钱
            userInfoModel.money -= summonData.consume;
            RecruitHero();
            userInfoService.SaveUserInfo(userInfoModel);
            dispatcher.Dispatch(CommandEvent.GetMoney);
        }
        else
        {
            Debug.Log("钱不够");
        }
    }
Ejemplo n.º 4
0
    public override void Execute()
    {
        var summonTable = SummonTableData.CreateFromJson();

        var summonInfoList = new List <Dictionary <string, System.Object> >();

        foreach (var summonData in summonTable.data)
        {
            summonInfoList.Add(new Dictionary <string, object>()
            {
                { "consume", summonData.consume },
                { "lv", summonData.lv },
                { "id", summonData.id },
                { "probability", summonData.probability },
                { "upgrade", summonData.upgrade },
                { "heroList", summonData.heroList },
                { "open", summonData.lv <= userInfoModel.summonLv }
            });
        }

        dispatcher.Dispatch(MediatorEvent.GetRecruitInfo, summonInfoList);
    }