private void DownLoadRemoteData() { Unity_Tools.StarTime("获取远程数据计时-------"); //判断有网时操作 if (!MainConfig.isFetchDb) { PublicClass.server_ip = vesal_network.Vesal_Network.get_ipfromlist(PublicClass.get_server_interface); PublicClass.server_test_url = PublicClass.server_ip + PublicClass.fix_server_interface; PublicClass.data_list_count = PublicClass.tableCount; PublicClass.DataManagerStatus = DataIntState.GoABdownload; } PublicClass.online_mode = MainConfig.isOnline; if (PublicClass.online_mode && vesal_network.Vesal_Network.get_network_is_acitve() & PPTGlobal.PPTEnv != PPTGlobal.PPTEnvironment.PPTPlayer) { try { PublicClass.server_ip = vesal_network.Vesal_Network.get_ipfromlist(PublicClass.get_server_interface); if (PublicClass.server_ip != "") { PublicClass.server_test_url = PublicClass.server_ip + PublicClass.fix_server_interface; DebugLog.DebugLogInfo("unity --------------------在线启动"); StartCoroutine(StartUpdateTable()); PublicClass.DataManagerStatus = DataIntState.FetchingDb; PublicClass.low_res_ablist = ""; } else { DebugLog.DebugLogInfo("unity --------------------离线启动"); PublicClass.online_mode = false; PublicClass.data_list_count = PublicClass.tableCount; PublicClass.DataManagerStatus = DataIntState.GoABdownload; } } catch { DebugLog.DebugLogInfo("unity --------------------离线启动"); } } else { PublicClass.online_mode = false; DebugLog.DebugLogInfo("unity --------------------离线启动"); PublicClass.data_list_count = PublicClass.tableCount; PublicClass.DataManagerStatus = DataIntState.GoABdownload; } }
//异步加载assetbundle资源列表 public void load_assets_A(Action load_complete = null) { Unity_Tools.StarTime("获取远程数据计时-------"); load_length = 0; load_count = 0; load_length = load_list.Count; DebugLog.DebugLogInfo("--------------------加载模型长度:" + load_length); for (int i = 0; i < load_list.Count; i++) { DebugLog.DebugLogInfo("--------------------: " + load_list[i].name); } StartCoroutine(LoadPrefabModel(PublicClass.filePath + load_list[0].name, Vesal_DirFiles.remove_name_suffix(load_list[0].name), count_load)); }
List <Download_Vesal_info> load_list;//异步加载assetbundle资源列表 public void load_assets_A(List <Download_Vesal_info> targetList, Action load_complete = null) { if (PublicClass.id_model_dic == null) { PublicClass.id_model_dic = new Dictionary <string, int>(); } load_list = new List <Download_Vesal_info>(); foreach (Download_Vesal_info temp in targetList) { if ((temp.type == null) || (temp.type.ToUpper() == "") || (temp.type.ToUpper() == "AB")) { load_list.Add(temp); PublicClass.total_load_list.Add(temp); } } //DebugLog.DebugLogInfo("--------------------可以加载模型长度:" + PublicClass.total_load_list.Count); //foreach (Download_Vesal_info temp in PublicClass.total_load_list) //{ // DebugLog.DebugLogInfo("total list:" + temp.name); //} //去掉多余的加载项 int max = load_list.Count; for (int k = PublicClass.int_load_AB_nums; k < max; k++) { load_list.RemoveAt(PublicClass.int_load_AB_nums); } Unity_Tools.StarTime("获取远程数据计时-------"); progress.Set_Progress("模型正在加载中...", Call); length = 0; count = 0; length = load_list.Count; DebugLog.DebugLogInfo("--------------------加载模型长度:" + length); ////加载公共库异常处理 //if (load_list.Count == 0) //{ // progress.Set_Progress("加载数据错误...", Call); //} //这是在未PPTPlayer 播放时,启动时指定vsl文件而给与解压 if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.PPTPlayer || PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.WeiKePlayer) { isUnzipDown = true; string[] CommandLineArgs = Environment.GetCommandLineArgs(); for (int i = 0; i < CommandLineArgs.Length; i++) { string tmpStr = CommandLineArgs[i]; //tmpStr = "C:\\vesalplayer\\WK0000001_5.vsl"; Debug.Log("GetCommandLineArgs::" + tmpStr); vesal_log.vesal_write_log("GetCommandLineArgs::" + tmpStr); if (tmpStr.Contains(".vsl") || tmpStr.Contains(".VSL")) { Debug.Log("GetCommandLineArgs::" + tmpStr); //SelectFile(tmpStr); PPTHomePageController.TempFilePath = PPTHomePageController.getTempPath(); vesal_log.vesal_write_log("PPTHomePageController.TempFilePath " + PPTHomePageController.TempFilePath); StartCoroutine(Vesal_DirFiles.UnZipAsync(tmpStr, PPTHomePageController.TempFilePath, ManagerModelUnzipCall, true)); PPTResourcePool.isSkipUnzip = true; isUnzipDown = false; PPTHomePageController.currentFilePath = tmpStr; break; } } } if (load_list.Count > 0) { //设置加载标记 start_load_model = true; timer = 0; // progress = GameObject.Find("LoadingCanvas").transform.GetComponent<ShowProgress>(); StartCoroutine(LoadPrefabModel(PublicClass.filePath + load_list[0].name, Vesal_DirFiles.remove_name_suffix(load_list[0].name), count_load)); } else { start_load_model = false; this.ReadModelInfo(); if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.demo_pc) { SceneManager.LoadScene("SceneSwitchInteral"); } else { SceneManager.LoadScene("SceneSwitch"); } } }