Skip to content

Commit b52f2b5

Browse files
committed
fix(UGUI): 禁用自动释放时跳过资源卸载
在禁用自动释放UI表单功能时,防止框架错误地卸载关联资源,确保手动管理的资源不会被意外释放
1 parent 6e15382 commit b52f2b5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Runtime/UGUIFormHelper.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ public override IUIForm CreateUIForm(object uiFormInstance, Type uiFormType, obj
177177
[UnityEngine.Scripting.Preserve]
178178
public override void ReleaseUIForm(object uiFormAsset, object uiFormInstance, object assetHandle, string uiFormAssetPath, string uiFormAssetName)
179179
{
180+
if (!m_UIComponent.EnableAutoReleaseUIForm)
181+
{
182+
return;
183+
}
184+
180185
if (uiFormAssetPath.IndexOf(Utility.Asset.Path.BundlesDirectoryName, StringComparison.OrdinalIgnoreCase) >= 0)
181186
{
182187
m_AssetComponent.UnloadAsset(uiFormAssetPath);

0 commit comments

Comments
 (0)