From 8ed4f93e246997a2ed667e7c3b1e3c6ee4fe532c Mon Sep 17 00:00:00 2001 From: ninemine <1371605831@qq.com> Date: Mon, 15 Dec 2025 11:54:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8A=E4=B8=8B=E6=96=87bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Framework/ScriptableObject.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Framework/ScriptableObject.cs b/Assets/Scripts/Framework/ScriptableObject.cs index ea03668..82248ca 100644 --- a/Assets/Scripts/Framework/ScriptableObject.cs +++ b/Assets/Scripts/Framework/ScriptableObject.cs @@ -318,8 +318,12 @@ namespace Demo return; } this.Parent = parent; - if (parent != null) + if (parent != null && parent.ScriptableObjectContents.IsCreated) { + if (ScriptableObjectContents.IsCreated == false) + { + ScriptableObjectContents = new(parent.ScriptableObjectContents.Count, AllocatorManager.Persistent); + } foreach (var item in parent.ScriptableObjectContents) { this.ScriptableObjectContents[item.Key] = item.Value; @@ -612,7 +616,8 @@ namespace Demo } // 释放资源 { - this.ScriptableObjectContents.Dispose(); + if (this.ScriptableObjectContents.IsCreated) + this.ScriptableObjectContents.Dispose(); } IsScriptApply = true; }