From 1461b91a948b78af6a733409a62253ca6f46ff82 Mon Sep 17 00:00:00 2001 From: hevinci Date: Wed, 3 Apr 2024 17:14:16 +0800 Subject: [PATCH] fix #268 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了挂起场景未解除状态前无法卸载的问题。 --- .../Operation/UnloadSceneOperation.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Assets/YooAsset/Runtime/ResourceManager/Operation/UnloadSceneOperation.cs b/Assets/YooAsset/Runtime/ResourceManager/Operation/UnloadSceneOperation.cs index 74bc291..9d4a750 100644 --- a/Assets/YooAsset/Runtime/ResourceManager/Operation/UnloadSceneOperation.cs +++ b/Assets/YooAsset/Runtime/ResourceManager/Operation/UnloadSceneOperation.cs @@ -31,6 +31,22 @@ namespace YooAsset { _error = null; _provider = provider; + + // 注意:卸载场景前必须先解除挂起操作 + if (provider is DatabaseSceneProvider) + { + var temp = provider as DatabaseSceneProvider; + temp.UnSuspendLoad(); + } + else if (provider is BundledSceneProvider) + { + var temp = provider as BundledSceneProvider; + temp.UnSuspendLoad(); + } + else + { + throw new System.NotImplementedException(); + } } internal override void InternalOnStart() {