mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-25 04:47:14 +08:00
refactor(core): 简化架构销毁逻辑并优化节点添加方式
- 将匿名 lambda 表达式简化为方法引用 - 使用 CallDeferred 替代直接调用 AddChild 方法以提高稳定性 - 移除不必要的代码嵌套层级,提升可读性
This commit is contained in:
parent
eae45625a7
commit
4157ef1384
@ -40,12 +40,9 @@ public abstract class AbstractArchitecture<T> : Architecture<T> where T : Archit
|
|||||||
Name = ArchitectureName
|
Name = ArchitectureName
|
||||||
};
|
};
|
||||||
|
|
||||||
anchor.Bind(() =>
|
anchor.Bind(Destroy);
|
||||||
{
|
|
||||||
Destroy();
|
|
||||||
});
|
|
||||||
|
|
||||||
tree.Root.AddChild(anchor);
|
tree.Root.CallDeferred(Node.MethodName.AddChild, anchor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user