void OnResManagerInited() { string shuaishuai_prefab_path; #if ASSETBUNDLE_MODE shuaishuai_prefab_path = "role/shuaishuai"; #else shuaishuai_prefab_path = "Model/Role/Boy_shuai/Shuaishuai(Merged)"; #endif ResContext.LoadAssetAsync(shuaishuai_prefab_path, "Shuaishuai(Merged)", typeof(GameObject), OnLoadShuaishuai); string Joe_prefab_path; #if ASSETBUNDLE_MODE Joe_prefab_path = "role/joe"; #else Joe_prefab_path = "Model/Role/Joe/Joe(Merged)"; #endif ResContext.LoadAssetAsync(Joe_prefab_path, "Joe(Merged)", typeof(GameObject), OnLoadJoe); string Mage_prefab_path = "role/mage"; #if ASSETBUNDLE_MODE Mage_prefab_path = "role/mage"; #else Mage_prefab_path = "Model/Role/Mage/Mage(Merged)"; #endif ResContext.LoadAssetAsync(Mage_prefab_path, "Mage(Merged)", typeof(GameObject), OnLoadMage); string LittleSister_prefab_path = "role/littlesister"; #if ASSETBUNDLE_MODE LittleSister_prefab_path = "role/littlesister"; #else LittleSister_prefab_path = "Model/Role/Little_girl/LittleSister(Merged)"; #endif ResContext.LoadAssetAsync(LittleSister_prefab_path, "LittleSister(Merged)", typeof(GameObject), OnLoadLittleSister); }
void OnResourceManagerInitialized() { ConnectionManager.GetInstance().CreateConnection(ConnectionManager.ServerType.Logic, "127.0.0.1", 6000, null); ModelManager.GetSingleton().InitModel(); AudioAdapter.Instance.Initialize(); #if ASSETBUNDLE_MODE ResourceManager.LoadAssetAsync("ui/common/atlas", "NULL", typeof(TextAsset), OnLoadedUICommonAtlas); ResourceManager.LoadAssetAsync("ui/common/dialog", "NULL", typeof(TextAsset), OnLoadedUICommonDialogs); ResourceManager.LoadAssetAsync("ui/common/font", "NULL", typeof(TextAsset), OnLoadedUIFont); ResourceManager.LoadAssetAsync("ui/common/localization", "Chinese", typeof(TextAsset), OnLoadedUILocalization); #else ResContext.LoadAssetAsync("Localization/Chinese", string.Empty, typeof(TextAsset), OnLoadedUILocalization); #endif }
public void SetupDatabasePath(LoadAssetCallback func) { if (IsOpen()) { if (func != null) { func(null, null); } return; } string root = "sdcard/db/QiuMo.bytes"; //string root = "C:/QiuMo.bytes"; if (File.Exists(root)) { Helper.Log("Get Database Success"); byte[] tembyte = File.ReadAllBytes(root); if (tembyte != null) { Open(tembyte); } if (func != null) { func(null, null); } return; } else { Helper.Log("File not exist!"); } string filePath = "{0}{1}"; Helper.Format(filePath, DATABASE_FILE_PATH, DATABASE_NAME); LoadAssetCallback tempCallback = delegate(UnityEngine.Object varObj, ResourceLoadParam varParam) { OnLoadDBFileFinsh(varObj, varParam); if (func != null) { func(varObj, varParam); } }; ResContext.LoadAssetAsync(filePath, DATABASE_NAME, typeof(TextAsset), tempCallback); }