Beispiel #1
0
        public async Task <LevelConfig> GetNewLevelConfig(string levelName)
        {
            LevelConfig newLevelConfig = new LevelConfig();

            // 房间 add by TangJian 2018/12/27 12:30
            newLevelConfig.rooms = await AssetManager.LoadJson <List <RoomConfig> >("Level/" + levelName + "/Rooms.json");

//                Tools.Json2Obj<List<RoomConfig>>(Tools.getJsonStringFromResource("Configs/Levels/" + levelName + "/Rooms"));

            // 房间连接 add by TangJian 2018/12/27 12:30
            for (int i = 1; i < 999; i++)
            {
                string pathString = await AssetManager.LoadString("Level/" + levelName + "/Path" + i + ".json");

                if (pathString == null)
                {
                    break;
                }
                PathConfig newPath = Tools.Json2Obj <PathConfig>(pathString);
                newLevelConfig.paths.Add(newPath);
            }

            // 房间怪物物品 add by TangJian 2018/12/27 12:31
            newLevelConfig.objectses =
                await AssetManager.LoadJson <List <RoomObjectesConfig> >("Level/" + levelName + "/Roles.json");

            // 读取场景事件 add by TangJian 2018/12/29 16:04
            newLevelConfig.sceneEvents =
                await AssetManager.LoadJson <SceneEvents>("Level/" + levelName + "/Events.json");

            return(newLevelConfig);
        }
Beispiel #2
0
        public async void LoadDecorationMap()
        {
            var armorDataMap = await AssetManager.LoadJson <Dictionary <string, DecorationData> >("DecorationDatas");

            foreach (KeyValuePair <string, DecorationData> kvp in armorDataMap)
            {
                itemDataDict.Add(kvp.Key, kvp.Value);
            }
        }
Beispiel #3
0
        public async void LoadSoulMap()
        {
            var consumableDataMap = await AssetManager.LoadJson <Dictionary <string, SoulData> >("SoulDatas");

            foreach (KeyValuePair <string, SoulData> kvp in consumableDataMap)
            {
                itemDataDict.Add(kvp.Key, kvp.Value);
            }
        }
Beispiel #4
0
        public async void LoadConsumableMap()
        {
            var otherItemMap = await AssetManager.LoadJson <Dictionary <string, ConsumableData> >("ConsumableDatas");

            foreach (KeyValuePair <string, ConsumableData> kvp in otherItemMap)
            {
                itemDataDict.Add(kvp.Key, kvp.Value);
            }
        }
Beispiel #5
0
        public async void LoadWeaponMap()
        {
            var weaponDataDict = await AssetManager.LoadJson <Dictionary <string, WeaponData> >("WeaponDatas");

            foreach (KeyValuePair <string, WeaponData> kvp in weaponDataDict)
            {
                itemDataDict.Add(kvp.Key, kvp.Value);
            }
        }
//        [RuntimeInitializeOnLoadMethod]
        public static async void LoadRes()
        {
            roleInteractionDic = await AssetManager.LoadJson <Dictionary <string, RoleInteraction> >(Definition.WalkOnGroundEffectFileName);
        }