Engine: 实现 Components 和 Scene 模块,包含完整单元测试
新增 Components 模块: - Component 基类 (生命周期、启用状态管理) - TransformComponent (本地/世界空间变换、矩阵缓存、父子层级) - GameObject (组件管理、父子层级、激活状态、静态查找) 新增 Scene 模块: - Scene (场景管理、对象创建销毁、查找、生命周期) - SceneManager (单例模式、多场景管理、场景切换) 新增测试: - test_component.cpp (12 个测试) - test_transform_component.cpp (35 个测试) - test_game_object.cpp (26 个测试) - test_scene.cpp (20 个测试) - test_scene_manager.cpp (17 个测试) 所有测试均已编译通过。
This commit is contained in:
@@ -60,7 +60,6 @@ public:
|
||||
// Hierarchy - parent
|
||||
TransformComponent* GetParent() const { return m_parent; }
|
||||
void SetParent(TransformComponent* parent, bool worldPositionStays = true);
|
||||
void SetParent(TransformComponent* parent) { SetParent(parent, true); }
|
||||
|
||||
// Hierarchy - children
|
||||
size_t GetChildCount() const { return m_children.size(); }
|
||||
|
||||
Reference in New Issue
Block a user