Fix editor selection system: SelectionManager ID types and Scene lookup
- SelectionManager now implements ISelectionManager interface with uint64_t IDs - Remove SelectionManager/SceneManager circular dependency via EventBus - Add Scene::FindByID() for proper ID-based entity lookup - SceneManager::GetEntity() now uses FindByID instead of name-based Find - Fix editor CMakeLists.txt XCEngine.lib path - EventBus now thread-safe with shared_mutex
This commit is contained in:
@@ -30,6 +30,7 @@ public:
|
||||
void DestroyGameObject(GameObject* gameObject);
|
||||
|
||||
GameObject* Find(const std::string& name) const;
|
||||
GameObject* FindByID(GameObjectID id) const;
|
||||
GameObject* FindGameObjectWithTag(const std::string& tag) const;
|
||||
|
||||
template<typename T>
|
||||
|
||||
@@ -79,6 +79,14 @@ GameObject* Scene::Find(const std::string& name) const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GameObject* Scene::FindByID(GameObjectID id) const {
|
||||
auto it = m_gameObjects.find(id);
|
||||
if (it != m_gameObjects.end()) {
|
||||
return it->second.get();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GameObject* Scene::FindInChildren(GameObject* parent, const std::string& name) const {
|
||||
for (size_t i = 0; i < parent->GetChildCount(); ++i) {
|
||||
GameObject* child = parent->GetChild(i);
|
||||
|
||||
Reference in New Issue
Block a user