tuyoogame / YooAsset

unity3d resources management system
https://www.yooasset.com/
Apache License 2.0
2.41k stars 469 forks source link

2.1.1版本中,如果当前有未结束的资源下载,调用ForceUnloadAllAssets会报错 #294

Closed jay-betta closed 1 month ago

jay-betta commented 5 months ago

堆栈如下: Exception: Exception: Bundle file loader is not done : xxxxxxxx.bundle

YooAsset.BundleLoaderBase.Destroy () (at <00000000000000000000000000000000>:0) YooAsset.AssetBundleFileLoader.Destroy () (at <00000000000000000000000000000000>:0) YooAsset.ResourceManager.ForceUnloadAllAssets () (at <00000000000000000000000000000000>:0) AssetManager.ReleaseAll (System.Boolean forceUnload) (at <00000000000000000000000000000000>:0) Quick.AppLauncher.InitalizeApp (System.Boolean isRestart) (at <00000000000000000000000000000000>:0) System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0) Quick.AppLauncher.InitalizeApp (System.Boolean isRestart) (at <00000000000000000000000000000000>:0) PuertsStaticWrap.Quick_AppLauncher_Wrap.M_InitalizeApp (System.IntPtr isolate, System.IntPtr info, System.IntPtr self, System.Int32 paramLen, System.Int64 data) (at <00000000000000000000000000000000>:0) --- End of stack trace from previous location where exception was thrown --- System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) (at <00000000000000000000000000000000>:0) UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <00000000000000000000000000000000>:0) UnityEngine.UnitySynchronizationContext.Exec () (at <00000000000000000000000000000000>:0)

jiangjiali commented 4 months ago

资源都没有下载完整,你为什么要强制释放资源呢????

jay-betta commented 4 months ago

因为游戏中有一部分是像网页一样,需要远程下载然后显示的,这部分跟主逻辑无关,在下载过程中,有可能玩家离开关掉这个页面了,所以需要释放掉

jiangjiali commented 4 months ago

因为游戏中有一部分是像网页一样,需要远程下载然后显示的,这部分跟主逻辑无关,在下载过程中,有可能玩家离开关掉这个页面了,所以需要释放掉

有道里。

gmhevinci commented 1 month ago

请升级到2.2版本,ForceUnloadAllAssets已经修改为异步的方式了。