修复上下文bug
This commit is contained in:
@@ -318,8 +318,12 @@ namespace Demo
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.Parent = parent;
|
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)
|
foreach (var item in parent.ScriptableObjectContents)
|
||||||
{
|
{
|
||||||
this.ScriptableObjectContents[item.Key] = item.Value;
|
this.ScriptableObjectContents[item.Key] = item.Value;
|
||||||
@@ -612,6 +616,7 @@ namespace Demo
|
|||||||
}
|
}
|
||||||
// 释放资源
|
// 释放资源
|
||||||
{
|
{
|
||||||
|
if (this.ScriptableObjectContents.IsCreated)
|
||||||
this.ScriptableObjectContents.Dispose();
|
this.ScriptableObjectContents.Dispose();
|
||||||
}
|
}
|
||||||
IsScriptApply = true;
|
IsScriptApply = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user