From 4157ef13849526b30c55dc33c26a2d4dd447bfc5 Mon Sep 17 00:00:00 2001 From: GwWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Wed, 17 Dec 2025 20:32:04 +0800 Subject: [PATCH] =?UTF-8?q?refactor(core):=20=E7=AE=80=E5=8C=96=E6=9E=B6?= =?UTF-8?q?=E6=9E=84=E9=94=80=E6=AF=81=E9=80=BB=E8=BE=91=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E8=8A=82=E7=82=B9=E6=B7=BB=E5=8A=A0=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将匿名 lambda 表达式简化为方法引用 - 使用 CallDeferred 替代直接调用 AddChild 方法以提高稳定性 - 移除不必要的代码嵌套层级,提升可读性 --- GFramework.Core.Godot/architecture/AbstractArchitecture.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/GFramework.Core.Godot/architecture/AbstractArchitecture.cs b/GFramework.Core.Godot/architecture/AbstractArchitecture.cs index 0219ff7..4022811 100644 --- a/GFramework.Core.Godot/architecture/AbstractArchitecture.cs +++ b/GFramework.Core.Godot/architecture/AbstractArchitecture.cs @@ -40,12 +40,9 @@ public abstract class AbstractArchitecture : Architecture where T : Archit Name = ArchitectureName }; - anchor.Bind(() => - { - Destroy(); - }); + anchor.Bind(Destroy); - tree.Root.AddChild(anchor); + tree.Root.CallDeferred(Node.MethodName.AddChild, anchor); } ///