Editor entity naming
This commit is contained in:
@@ -26,6 +26,7 @@ EditorSystem::EditorSystem(World* world, EventBroker* eventBroker, IRenderer* re
|
||||
m_EditorGUI->SetEntityCreateCallback(std::bind(&EditorSystem::OnEntityCreate, this, std::placeholders::_1));
|
||||
m_EditorGUI->SetEntityDeleteCallback(std::bind(&EditorSystem::OnEntityDelete, this, std::placeholders::_1));
|
||||
m_EditorGUI->SetEntityChangeParentCallback(std::bind(&EditorSystem::OnEntityChangeParent, this, std::placeholders::_1, std::placeholders::_2));
|
||||
m_EditorGUI->SetEntityChangeNameCallback(std::bind(&EditorSystem::OnEntityChangeName, this, std::placeholders::_1, std::placeholders::_2));
|
||||
m_EditorGUI->SetComponentAttachCallback(std::bind(&EditorSystem::OnComponentAttach, this, std::placeholders::_1, std::placeholders::_2));
|
||||
m_EditorGUI->SetComponentDeleteCallback(std::bind(&EditorSystem::OnComponentDelete, this, std::placeholders::_1, std::placeholders::_2));
|
||||
|
||||
@@ -85,6 +86,11 @@ void EditorSystem::OnEntityChangeParent(EntityWrapper entity, EntityWrapper pare
|
||||
entity.World->SetParent(entity.ID, parent.ID);
|
||||
}
|
||||
|
||||
void EditorSystem::OnEntityChangeName(EntityWrapper entity, const std::string& name)
|
||||
{
|
||||
entity.World->SetName(entity.ID, name);
|
||||
}
|
||||
|
||||
void EditorSystem::OnComponentAttach(EntityWrapper entity, const std::string& componentType)
|
||||
{
|
||||
entity.World->AttachComponent(entity.ID, componentType);
|
||||
|
||||
Reference in New Issue
Block a user