/// <summary> /// 初始化热更新地址信息 /// </summary> private void initHotUpdateConfig() { mHotUpdateConfig = null; Debug.Log(string.Format("mHotUpdateConfigFilePath : {0}", mHotUpdateConfigFilePath)); //读取包内的热更信息 var hotupdateconfigasset = Resources.Load <TextAsset>(mHotUpdateConfigFilePath); if (hotupdateconfigasset != null) { Debug.Log("热更新地址信息信息:"); var content = mUTF8Encoding.GetString(hotupdateconfigasset.bytes); Debug.Log(string.Format("content : {0}", content)); mHotUpdateConfig = JsonUtility.FromJson <HotUpdateConfig>(content); Debug.Log(string.Format("APKName : {0} HotUpdateLocalURL : {1} HotUpdateURL : {2}", mHotUpdateConfig.APKName, mHotUpdateConfig.HotUpdateLocalURL, mHotUpdateConfig.HotUpdateURL)); mVersionHotUpdateFileName = mHotUpdateConfig.APKName; VersionHotUpdateCacheFilePath = VersionHotUpdateCacheFolderPath + mVersionHotUpdateFileName; #if DEVELOPMENT mHotUpdateURL = mHotUpdateConfig.HotUpdateLocalURL; #else mHotUpdateURL = mHotUpdateConfig.HotUpdateURL; #endif } else { Debug.LogError(string.Format("包内热更地址信息文件 : {0}不存在!", mHotUpdateConfigFilePath)); } }
public HotUpdateModuleManager() { HotUpdateSwitch = true; mHotUpdateConfigFilePath = ConfigFolderPath + mVersionConfigFileName; mHotUpdateConfig = null; mHotUpdateURL = string.Empty; mHotUpdateResourceTotalNumber = 0; VersionHotUpdateCacheFolderPath = Application.persistentDataPath + "/download/"; mVersionHotUpdateFileName = string.Empty; HotVersionUpdateRequest = new TWebRequest(); mVersionHotUpdateCompleteCB = null; mNeedHotUpdateResourceMap = new SortedDictionary <int, List <string> >(); mResourceHotUpdateCompleteCB = null; mResourceUpdateListMap = new Dictionary <int, List <string> >(); mLocalUpdatedResourceMap = new SortedDictionary <int, List <string> >(); LocalResourceUpdateListFilFolderPath = Application.persistentDataPath + "/ResourceUpdateList/"; LocalResourceUpdateListFilePath = LocalResourceUpdateListFilFolderPath + ResourceUpdateListFileName; mHotResourceUpdateRequest = new TWebRequest(); }