Example #1
0
    static void GetSceneFenBaoAsset()
    {
        _levelConfigArray = LoadConfigFile <LevelConfigArray>("L_Resources/DataConfig/dataconfig_levelconfig");
        _sceneFenBaoArray = LoadConfigFile <SceneFenBaoArray>("L_Resources/DataConfig/dataconfig_scenefenbao");

        for (int i = 0; i < _sceneFenBaoArray.items.Count; i++)
        {
            SceneFenBao sceneFenBao  = _sceneFenBaoArray.items[i];
            uint        sceneId      = sceneFenBao.ID;
            uint        packageIndex = sceneFenBao.Pakage;

            if (sceneFenBao.Version != _fenBaoVersion)
            {
                continue;
            }

            SceneConfig sceneConfig = GetSceneConfig(sceneId);

            for (int j = 0; j < sceneConfig.Objects.Count; j++)
            {
                string abName = GetAssetOfABNameByPath(sceneConfig.Objects[j].Path);
                string abPath = _sourcePath + "/" + abName;
                BuildResPackageInfo("GetSceneFenBaoAsset", abPath, packageIndex);
            }
        }
    }
Example #2
0
 public LevelConfigManager()
 {
     using (StreamReader reader = new StreamReader(File.OpenRead(levelConfigurationFilePath)))
     {
         string jsonString = reader.ReadToEnd();
         Debug.Log(jsonString);
         LevelConfigArray levelConfigArray = JsonUtility.FromJson <LevelConfigArray>(jsonString);
         foreach (LevelConfig levelConfig in levelConfigArray.array)
         {
             Debug.Log($"Processing Level Config {levelConfig.name}");
             levelData.Add(levelConfig);
         }
     }
     Debug.Log("Completed Loading Level Configurations...");
     foreach (string name in levelData.Select(x => x.name))
     {
         Debug.Log($"Level: \"{name}\", has had its configuration loaded.");
     }
 }