refactor(core): 简化架构销毁逻辑并优化节点添加方式

- 将匿名 lambda 表达式简化为方法引用
- 使用 CallDeferred 替代直接调用 AddChild 方法以提高稳定性
- 移除不必要的代码嵌套层级,提升可读性
This commit is contained in:
GwWuYou 2025-12-17 20:32:04 +08:00
parent eae45625a7
commit 4157ef1384

View File

@ -40,12 +40,9 @@ public abstract class AbstractArchitecture<T> : Architecture<T> where T : Archit
Name = ArchitectureName
};
anchor.Bind(() =>
{
Destroy();
});
anchor.Bind(Destroy);
tree.Root.AddChild(anchor);
tree.Root.CallDeferred(Node.MethodName.AddChild, anchor);
}
/// <summary>