private IEnumerator InitBiomes() { AsyncAsset json = AssetManager.Instance.LoadAsset <TextAsset>(m_BiomeTableJson); yield return(json); m_Biomes = JsonConvert.DeserializeObject <BiomeData[]>(json.GetAssetAs <TextAsset>().text); AssetManager.Instance.UnloadAsset(json); m_BiomeMap = new Dictionary <string, BiomeData>(m_Biomes.Length); for (int i = 0; i < m_Biomes.Length; i++) { BiomeData biome = m_Biomes[i]; m_BiomeMap.Add(biome.InternalName, biome); } }
public IEnumerator Initialize() { m_LuaEnv = new LuaEnv(); m_LuaEnv.AddLoader(LoadLuaFile); m_LuaFileAssets = new List <AsyncAsset>(); m_LuaFileMap = new Dictionary <string, LuaAsset>(); for (int i = 0; i < m_LuaAssetBundles.Length; i++) { m_LuaFileAssets.AddRange(AssetManager.Instance.LoadAllAssets(m_LuaAssetBundles[i])); } yield return(AsyncAsset.WaitAll(m_LuaFileAssets)); for (int i = 0; i < m_LuaFileAssets.Count; i++) { AsyncAsset asset = m_LuaFileAssets[i]; m_LuaFileMap.Add(asset.AssetName, asset.GetAssetAs <LuaAsset>()); } }