From 261d8d2135179236d17b6163fc65e427a420e67c Mon Sep 17 00:00:00 2001 From: ChestnutYueyue <952134128@qq.com> Date: Tue, 10 Feb 2026 17:42:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9C=BA=E6=99=AF=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E5=9C=A8=E5=9C=BA=E6=99=AF=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E6=97=B6=E8=B0=83=E7=94=A8=E7=88=B6=E7=B1=BBonEnter=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调用父类的onEnter方法以正确设置running_状态,并触发子节点的onAttachToScene,从而将节点正确注册到空间索引 --- examples/spatial_index_demo/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/spatial_index_demo/main.cpp b/examples/spatial_index_demo/main.cpp index 8969bd7..f6b51cd 100644 --- a/examples/spatial_index_demo/main.cpp +++ b/examples/spatial_index_demo/main.cpp @@ -92,6 +92,10 @@ private: class SpatialIndexDemoScene : public Scene { public: void onEnter() override { + // 必须先调用父类的 onEnter(),这样才能正确设置 running_ 状态 + // 并触发子节点的 onAttachToScene,将节点注册到空间索引 + Scene::onEnter(); + E2D_LOG_INFO("SpatialIndexDemoScene::onEnter - 引擎空间索引演示"); auto &app = Application::instance();