예제 #1
0
    private void SetMonsterList(int mapId, GameObject gameObject)
    {
        int        firstRuleId = Cfg_Map.GetCfg(mapId).GenMonsterRule;
        List <int> genRuleList = new List <int>()
        {
            firstRuleId
        };

        for (int i = 0; i < 100; i++)
        {
            int nextRule = Cfg_GenMon.GetCfg(firstRuleId).NextRule;
            if (nextRule != 0)
            {
                genRuleList.Add(nextRule);
                firstRuleId = nextRule;
            }
            else
            {
                break;
            }
        }
        //foreach (var genRuleId in genRuleList)
        //{
        //    Cfg_GenMon cfg_GenMon = Cfg_GenMon.GetCfg(genRuleId);
        //    Cfg_NPC cfg_NPC = Cfg_NPC.GetCfg(cfg_GenMon.MonsterId);
        //    UI_ListItem = UIBase.InitListItem(gameObject);
        //    string Asset = COMMON.MonsterIconPath + cfg_NPC.AssetName;
        //    UIBase.SetImageSpite(UI_ListItem.Images[0], Asset);
        //}
        UIBase.ResetListPos(gameObject);
    }
예제 #2
0
    void SetMapNameText(int mapId)
    {
        if (mapId == 0)
        {
            return;
        }
        MapNameText.text = Cfg_Map.GetCfg(mapId).Name;
        int chapterId = Cfg_Map.GetCfg(mapId).ChapterId;

        ChapterNameText.text = Cfg_Chapter.GetCfg(chapterId).Name;
    }
예제 #3
0
    private void SetMapList(int startMap)
    {
        List <int> mapList = new List <int>()
        {
            startMap
        };

        for (int i = 0; i < 100; i++)
        {
            int nextMap = Cfg_Map.GetCfg(startMap).NextMap;
            if (nextMap != 0)
            {
                mapList.Add(nextMap);
                startMap = nextMap;
            }
            else
            {
                break;
            }
        }
        bool lastMapIsPass = true;

        foreach (var map in mapList)
        {
            UI_ListItem = UIBase.InitListItem(MapListObj);
            UI_ListItem.Texts[0].text = Cfg_Map.GetCfg(map).Name;
            UI_ListItem.Texts[1].text = Cfg_Map.GetCfg(map).Des;
            bool IsPass = AlreadyPass.Contains(map);
            UI_ListItem.Objs[0].SetActive(!IsPass && lastMapIsPass);
            UI_ListItem.Objs[1].SetActive(IsPass || !lastMapIsPass);
            if (IsPass && lastMapIsPass)
            {
                UI_ListItem.Texts[2].text = "已通关";
            }
            else
            {
                UI_ListItem.Texts[2].text = "需通关上一关";
            }
            lastMapIsPass = IsPass;
            UI_ListItem.btns[0].onClick.AddListener(delegate()
            {
                gameObject.SetActive(false);
                GenerateMap.CurrentMapId = map;
            });
            SetMonsterList(map, UI_ListItem.Objs[2]);
        }
        UIBase.ResetListPos(MapListObj, 1);
    }
예제 #4
0
    public static void MapGenMonster(List <BrickRoot> brickRoots, int mapId)
    {
        int        ruleId     = Cfg_Map.GetCfg(mapId).GenMonsterRule;
        Cfg_GenMon cfg_GenMon = Cfg_GenMon.GetCfg(ruleId);
        //怪物ID列表
        List <int> monsterList = new List <int>();
        //掉落列表
        List <int> dropList = new List <int>();

        for (int i = 0; i < 100; i++)
        {
            switch (cfg_GenMon.Type)
            {
            case 0:
                monsterList.Add(cfg_GenMon.Parameter);
                break;

            case 1:
                dropList.Add(cfg_GenMon.Parameter);
                break;
            }
            if (cfg_GenMon.NextRule != 0)
            {
                cfg_GenMon = Cfg_GenMon.GetCfg(cfg_GenMon.NextRule);
            }
            else
            {
                break;
            }
        }
        //生成怪物
        List <BrickRoot> bricks = GenBrickMonster(brickRoots, monsterList);

        //生成装备
        GenBrickEquip(bricks, dropList);
    }
예제 #5
0
 void GoNextMap()
 {
     GenerateMap.CurrentMapId = Cfg_Map.GetCfg(GenerateMap.CurrentMapId).NextMap;
 }