Skip to content

Commit be3882a

Browse files
author
Jiang Yin
committed
资源更新增加停止更新功能
1 parent ce419ce commit be3882a

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

GameFramework/Resource/ResourceManager.ResourceUpdater.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public void Update(float elapseSeconds, float realElapseSeconds)
223223
UpdateInfo updateInfo = m_UpdateWaitingInfo[0];
224224
m_UpdateWaitingInfo.RemoveAt(0);
225225
string resourceFullNameWithCrc32 = updateInfo.ResourceName.Variant != null ? Utility.Text.Format("{0}.{1}.{2:x8}.{3}", updateInfo.ResourceName.Name, updateInfo.ResourceName.Variant, updateInfo.HashCode, DefaultExtension) : Utility.Text.Format("{0}.{1:x8}.{2}", updateInfo.ResourceName.Name, updateInfo.HashCode, DefaultExtension);
226-
m_DownloadManager.AddDownload(updateInfo.ResourcePath, Utility.Path.GetRemotePath(Path.Combine(m_ResourceManager.m_UpdatePrefixUri, resourceFullNameWithCrc32)), updateInfo);
226+
m_DownloadManager.AddDownload(updateInfo.ResourcePath, Utility.Path.GetRemotePath(Path.Combine(m_ResourceManager.m_UpdatePrefixUri, resourceFullNameWithCrc32)), DownloadTag, updateInfo);
227227
m_UpdatingCount++;
228228
}
229229

GameFramework/Resource/ResourceManager.VersionListProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void UpdateVersionList(int versionListLength, int versionListHashCode, in
146146
string localVersionListFilePath = Utility.Path.GetRegularPath(Path.Combine(m_ResourceManager.m_ReadWritePath, RemoteVersionListFileName));
147147
int dotPosition = RemoteVersionListFileName.LastIndexOf('.');
148148
string latestVersionListFullNameWithCrc32 = Utility.Text.Format("{0}.{2:x8}.{1}", RemoteVersionListFileName.Substring(0, dotPosition), RemoteVersionListFileName.Substring(dotPosition + 1), m_VersionListHashCode);
149-
m_DownloadManager.AddDownload(localVersionListFilePath, Utility.Path.GetRemotePath(Path.Combine(m_ResourceManager.m_UpdatePrefixUri, latestVersionListFullNameWithCrc32)), this);
149+
m_DownloadManager.AddDownload(localVersionListFilePath, Utility.Path.GetRemotePath(Path.Combine(m_ResourceManager.m_UpdatePrefixUri, latestVersionListFullNameWithCrc32)), DownloadTag, this);
150150
}
151151

152152
private void OnDownloadSuccess(object sender, DownloadSuccessEventArgs e)

GameFramework/Resource/ResourceManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ internal sealed partial class ResourceManager : GameFrameworkModule, IResourceMa
2323
private const string LocalVersionListFileName = "GameFrameworkList.dat";
2424
private const string DefaultExtension = "dat";
2525
private const string BackupExtension = "bak";
26+
private const string DownloadTag = "Resource Manager";
2627
private const int FileSystemMaxFileCount = 1024 * 16;
2728
private const int FileSystemMaxBlockCount = 1024 * 256;
2829

0 commit comments

Comments
 (0)