Ejemplo n.º 1
0
    /// <summary>
    /// 首先找到Floor,如果是Boss关卡,则要查找City,如果是City是最后一个中关卡,则要查找Chapter,如果是最后一个Chpater,则没有新的大关卡。
    /// 如果不是boss关卡, 则仅仅更新Floor的status
    /// directly 是直接打的吗?
    /// </summary>
    /// <param name="finishFloorId">Finish floor identifier.</param>
    private void OnFinishFloor(int finishFloorId, bool isWin)
    {
        isLastPlayFloor = finishFloorId;

        changed.reset();

        Floor floor = null;

        FloorList.TryGetValue(finishFloorId, out floor);
        Utils.Assert(floor == null, "Can't find Floor. floorId = " + finishFloorId.ToString());

        City city = null;

        CityList.TryGetValue(reverseToCity(finishFloorId).ID, out city);
        Utils.Assert(city == null, "Can't find City. CityId = " + reverseToCity(finishFloorId).ID);

        if (floor.isBoss)
        {
            if (isWin)
            {
                lastFloorId = Math.Max(lastFloorId, finishFloorId);
                // talkingdata     add by  wxl
//                if (city != null && floor != null) {
//                    Core.Data.ActivityManager.OnMissionComplete (city.config.name + " , " + floor.config.name);
//                }
            }
//            } else {
//                // talkingdata     add by  wxl
//                Core.Data.ActivityManager.OnMissionFail (city.config.name + " , " + floor.config.name);
//            }


            if (city.toFightFloorId == finishFloorId)
            {
                OnFinishFloor(finishFloorId, city, false, isWin);
            }
            else
            {
                OnFinishFloor(finishFloorId, city, true, isWin);
            }
        }
        else
        {
            lastFloorId = Math.Max(lastFloorId, finishFloorId);
            OnFinishFloor(finishFloorId, city, false, isWin);
        }

        //RED.Log(">>>>>>>>>>>lastFloorId<<<<<<<<<<<="+lastFloorId.ToString()+"  finishFloorId="+finishFloorId.ToString()+ "   isWin="+isWin.ToString());
    }
Ejemplo n.º 2
0
    public DungeonsManager()
    {
        isFristRun        = true;
        isWinOfLastFloor  = true;
        isBossOfLastFloor = true;
        ChapterConfigList = new Dictionary <int, ChapterData>();
        CityConfigList    = new Dictionary <int, CityData>();
        FloorConfigList   = new Dictionary <int, FloorData>();
        //反向分析
        reverse = new Dictionary <int, int>();

        ChapterList = new Dictionary <int, Chapter>();
        CityList    = new Dictionary <int, City>();
        FloorList   = new Dictionary <int, Floor>();

        lastFloorId = 0;

        changed = new WhichChange();
        changed.reset();
        //关卡 和奖励
        floorAndRewardDic = new Dictionary <int, List <int> > ();
    }