Browse Source

Preserve node name when loading prefab

Josh Engebretson 10 years ago
parent
commit
e9fe2a3995
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Source/Atomic/Scene/PrefabComponent.cpp

+ 3 - 0
Source/Atomic/Scene/PrefabComponent.cpp

@@ -69,11 +69,14 @@ void PrefabComponent::LoadPrefabNode()
     Quaternion rot = node->GetRotation();
     Vector3 scale = node->GetScale();
 
+    String name = node->GetName();
+
     node->LoadXML(xmlfile->GetRoot());
 
     node->SetPosition(pos);
     node->SetRotation(rot);
     node->SetScale(scale);
+    node->SetName(name);
 
     // Get the root components of the load node
     const Vector<SharedPtr<Component>>& rootComponents = node->GetComponents();