/// <summary> /// 新建一个资源版本 /// </summary> /// <param name="remoteRootURL">远端资源服务器网关</param> /// <param name="isUpdateVersion">是否迭代资源版本</param> /// <param name="isUpdateResVersion">是否迭代资源大版本</param> /// <param name="isSyncAppVersion">是否同步应用版本</param> /// <param name="remoteVers">远端资源服务器的资源配置</param> /// <param name="abNames">需要迭代版本的资源名</param> public void CreateNewResVersion(ref string remoteRootURL, bool isUpdateVersion, bool isUpdateResVersion, bool isSyncAppVersion, ref ResDataVersion remoteVers, ref string[] abNames) { res_gateway = remoteRootURL; Init(); remoteVers?.Init(); CheckMainManifestVersion(ref abNames); FillChangedABList(out List <string> changeds); int max = abNames.Length; CheckTotalVersion(isUpdateResVersion, isSyncAppVersion, max); CheckResVersions(max, ref abNames, ref remoteVers, isUpdateVersion, ref changeds); }
/// <summary> /// 从另一个资源版本对象复制数据 /// </summary> /// <param name="copyFrom"></param> public void CloneVersionsFrom(ref ResDataVersion copyFrom) { Clean(false, true); if (copyFrom.IsVersionsEmpty()) { copyFrom.Init(); } else { } app_version = copyFrom.app_version; res_version = copyFrom.res_version; res_gateway = copyFrom.res_gateway; ResVersion item; int resSize = copyFrom.res.Length; res = new ResVersion[resSize]; for (int i = 0; i < resSize; i++) { item = copyFrom.res[i]; res[i] = ResVersion.CreateNew(item.name, item.version, item.file_size); } int updatingsSize = copyFrom.updatings != default ? copyFrom.updatings.Length : 0; updatings = new ResUpdating[updatingsSize]; for (int i = 0; i < updatingsSize; i++) { updatings[i] = new ResUpdating() { name = copyFrom.updatings[i].name, version = copyFrom.updatings[i].version, }; } res_total = res.Length; updating_total = updatings.Length; }