public void ReloadConfig() { m_bundleDic.Clear(); m_assetDic.Clear(); string fullPath = PathUtils.GetVaildFullPath("bundle_info.json"); BundleInfoConfig bundleCfg = SerializeHelper.LoadFromFile <BundleInfoConfig>(fullPath); if (bundleCfg != null) { for (int i = 0; i < bundleCfg.bundleInfo.Count; ++i) { BundleInfo info = bundleCfg.bundleInfo[i]; m_bundleDic.Add(info.name, info); } } fullPath = PathUtils.GetVaildFullPath("asset_info.json"); AssetInfoConfig assetCfg = SerializeHelper.LoadFromFile <AssetInfoConfig>(fullPath); if (assetCfg != null) { for (int i = 0; i < assetCfg.assetInfo.Count; ++i) { AssetInfo info = assetCfg.assetInfo[i]; m_assetDic.Add(info.name, info); } } }
public static void SetAssetBundleInfo() { //MakePrefabAssetbundleName("Assets/Resources"); string build = Application.dataPath + "/build.json"; buildInfo = SerializeHelper.LoadFromFile <BuildInfo>(build); buildInfo.MarkBundleName(); }
void DoCheck() { string verFile = PathUtils.GetVaildFullPath("version.json"); m_verRes = SerializeHelper.LoadFromFile <VersionRes>(verFile); //这个大版本要写在程序里,才能保证获取的本地当前版本是对的!!! string[] programVersion = VersionResDef.version.Split('.'); string[] oldVersion = VersionUpdate.GetIns().GetVersion().Split('.'); string[] newVersion = m_verRes.version.Split('.'); string[] miniVersion = m_verRes.miniVersion.Split('.'); //强制更新apk,ios if (int.Parse(programVersion[0]) < int.Parse(miniVersion[0]) || int.Parse(programVersion[1]) < int.Parse(miniVersion[1]) ) { if (Application.platform == RuntimePlatform.Android) { DownloadMgr.GetInst().CreateTask(m_verRes.apk, m_verRes.apkSignature, DownloadApkResult); } else if (Application.platform == RuntimePlatform.IPhonePlayer) { //todo... } else { //todo... } return; } int oldBigVersion = int.Parse(programVersion[0]); int newBigVersion = int.Parse(newVersion[0]); if (newBigVersion > oldBigVersion) { //todo...可选更新apk,ios } VersionUpdate.GetIns().SetVersion(m_verRes); m_mgr.ChangeNextStatus(); }
public void Init() { m_statusMgr.RegisterStatus(new AppChannelStatus()); m_statusMgr.RegisterStatus(new GameVersionStatus()); m_statusMgr.RegisterStatus(new ResDownloadStatus()); m_statusMgr.RegisterStatus(new GameStatus()); DownloadMgr.GetInst().Init(); m_statusMgr.Init(); string verFile = PathUtils.GetVaildFullPath("version.json"); if (verFile.Length > 0) { m_verRes = SerializeHelper.LoadFromFile <VersionRes>(verFile); } if (m_verRes == null) { LogUtils.LogError("verFile can not find!"); return; } }