/// <summary> /// 设置资源在读写区中的信息。 /// </summary> /// <param name="loadType">资源加载方式。</param> /// <param name="length">资源大小。</param> /// <param name="hashCode">资源哈希值。</param> public void SetReadWriteInfo(LoadType loadType, int length, int hashCode) { if (m_ReadWriteInfo.Exist) { throw new GXException(Utility.Text.Format("You must set read-write info of '{0}' only once.", m_ResourceName.FullName)); } m_ReadWriteInfo = new LocalVersionInfo(loadType, length, hashCode); }
/// <summary> /// 初始化资源检查信息的新实例。 /// </summary> /// <param name="resourceName">资源名称。</param> public CheckInfo(ResourceName resourceName) { m_ResourceName = resourceName; m_Status = CheckStatus.Unknown; m_NeedRemove = false; m_VersionInfo = default(RemoteVersionInfo); m_ReadOnlyInfo = default(LocalVersionInfo); m_ReadWriteInfo = default(LocalVersionInfo); }
/// <summary> /// 设置资源在读写区中的信息 /// </summary> /// <param name="length">资源大小</param> /// <param name="hashCode">资源哈希值</param> public void SetReadWriteInfo(int length, int hashCode) { if (m_ReadWriteInfo.Exist) { throw new Exception(TextUtil.Format("You must set read-write info of '{0}' only once.", m_ResourceName)); } m_ReadWriteInfo = new LocalVersionInfo(length, hashCode); }
/// <summary> /// 设置资源在只读区中的信息。 /// </summary> /// <param name="loadType">资源加载方式。</param> /// <param name="length">资源大小。</param> /// <param name="hashCode">资源哈希值。</param> public void SetReadOnlyInfo(LoadType loadType, int length, int hashCode) { if (m_ReadOnlyInfo.Exist) { throw new AshException(string.Format("You must set readonly info of '{0}' only once.", m_ResourceName.FullName)); } m_ReadOnlyInfo = new LocalVersionInfo(loadType, length, hashCode); }
/// <summary> /// 设置资源在只读区中的信息。 /// </summary> /// <param name="loadType">资源加载方式。</param> /// <param name="length">资源大小。</param> /// <param name="hashCode">资源哈希值。</param> public void SetReadOnlyInfo(LoadType loadType, int length, int hashCode) { if (m_ReadOnlyInfo.Exist) { throw new GameFrameworkException(Utility.Text.Format("You must set readonly info of '{0}' only once.", m_ResourceName.FullName)); } m_ReadOnlyInfo = new LocalVersionInfo(m_CachedFileSystemName, loadType, length, hashCode); m_CachedFileSystemName = null; }
/// <summary> /// 初始化资源检查信息的新实例。 /// </summary> /// <param name="resourceName">资源名称。</param> public CheckInfo(ResourceName resourceName) { m_ResourceName = resourceName; m_Status = CheckStatus.Unknown; m_NeedRemove = false; m_NeedMoveToDisk = false; m_NeedMoveToFileSystem = false; m_VersionInfo = default(RemoteVersionInfo); m_ReadOnlyInfo = default(LocalVersionInfo); m_ReadWriteInfo = default(LocalVersionInfo); m_CachedFileSystemName = null; }
///<inheritdoc cref="IVersionCheck"/> ///<exception cref="GameFrameworkException">Check 函数还未执行过或还未执行完成 </exception> /// <returns></returns> public IEnumerable <AssetBundleInfo> GetGroupVersion(string tag) { if (!_isInitCheck) { throw new GameFrameworkException("没有执行Check 函数或还未执行完成~"); } var serverABs = ServerVersionInfo.GetGroupAssetBundleInfos(tag); var localABs = LocalVersionInfo.GetGroupAssetBundleInfos(tag); return(_chckAssetBundleList(serverABs, localABs)); }
public bool IsUpdateGroup(string tag) { if (!_isInitCheck) { throw new GameFrameworkException("没有执行Check 函数或还未执行完成~"); } var serverABs = ServerVersionInfo.GetGroupAssetBundleInfos(tag); var localABs = LocalVersionInfo.GetGroupAssetBundleInfos(tag); return(_existUpdateAssetBundle(serverABs, localABs)); }
//------------------------------------------------------------------------- public VersionInfo(string local_assetinfo_path) { LocalBundleVersion = Application.version; LocalAssetInfoPath = local_assetinfo_path; MapLocalAssetInfo = new Dictionary <string, string>(); MapRemoteAssetInfo = new Dictionary <string, string>(); // Load Local VersionInfo string data = PlayerPrefs.GetString(AutoPatcherStringDef.PlayerPrefsKeyLocalVersionInfo); if (string.IsNullOrEmpty(data)) { LocalVersionInfo info; info.data_version = ""; info.remote_version_url = ""; LocalVersionInfo = info; } else { LocalVersionInfo = EbTool.jsonDeserialize <LocalVersionInfo>(data); } // Parse Local DataFileList if (File.Exists(LocalAssetInfoPath)) { // 读取本地DataFileList.txt文件成功 _parseDataFileList(File.ReadAllText(LocalAssetInfoPath), true); } else { // 读取本地DataFileList.txt文件失败 LocalVersionInfo info = LocalVersionInfo; info.data_version = ""; LocalVersionInfo = info; data = EbTool.jsonSerialize(LocalVersionInfo); PlayerPrefs.SetString(AutoPatcherStringDef.PlayerPrefsKeyLocalVersionInfo, data); } }