Skip to content

Commit 070be2c

Browse files
author
wanderer
committed
修复单个资源更新的Bug
1 parent 68be54a commit 070be2c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

GameFramework/Runtime/Resource/BundleAssetsHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ public void UnloadAssetBunlde(string assetBundleName, bool unload = false)
203203
{
204204
_assetBundleReferenceCount.Remove(assetBundle);
205205
}
206+
_liveAssetBundle.Remove(assetBundleName);
206207
assetBundle.Unload(unload);
207208
}
208209
}

GameFramework/Runtime/Resource/ResourceVersion.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,11 @@ public bool UpdateResource(Action<float, double, double, float> callback, Action
178178
if (_updating)
179179
return false;
180180

181-
if (!CheckResource())
181+
if (string.IsNullOrEmpty(name) && !CheckResource())
182182
{
183183
return false;
184184
}
185+
185186
_updating = true;
186187
//整理下载资源
187188
CollateDownloadResources((needDownloadFiles)=> {
@@ -331,7 +332,10 @@ private void DownloadFiles(List<AssetHashInfo> needDownloadFiles,Action<float, d
331332
//更新本地资源
332333
if (downloadFileCount == needDownloadFiles.Count)
333334
{
334-
UpdateLocalVersion();
335+
if (CheckResource())
336+
{
337+
UpdateLocalVersion();
338+
}
335339
}
336340
needDownloadFiles = null;
337341
_updating = false;

0 commit comments

Comments
 (0)