Scene::GetEventDispatcher()改为返回引用而非指针

This commit is contained in:
2025-07-27 07:41:48 +08:00
parent 729ad1e39a
commit 69ed5eb859
2 changed files with 4 additions and 4 deletions

View File

@@ -40,9 +40,9 @@ namespace hgl::graph
SAFE_CLEAR(root_node); SAFE_CLEAR(root_node);
} }
io::EventDispatcher *GetEventDispatcher() ///<获取事件分发器 io::EventDispatcher &GetEventDispatcher() ///<获取事件分发器
{ {
return &event_dispatcher; return event_dispatcher;
} }
};//class Scene };//class Scene

View File

@@ -132,12 +132,12 @@ namespace hgl::graph
{ {
if(main_scene) if(main_scene)
{ {
main_scene->GetEventDispatcher()->RemoveChildDispatcher(self_ep); //从旧的场景中移除事件分发器 main_scene->GetEventDispatcher().RemoveChildDispatcher(self_ep); //从旧的场景中移除事件分发器
} }
if(new_scene) if(new_scene)
{ {
new_scene->GetEventDispatcher()->AddChildDispatcher(self_ep); //添加到新的场景中 new_scene->GetEventDispatcher().AddChildDispatcher(self_ep); //添加到新的场景中
} }
} }