From 8589bb99de0b1e0d50881ded01adddaa64895c34 Mon Sep 17 00:00:00 2001 From: Mikhail Naumov Date: Wed, 18 Aug 2021 12:01:07 -0700 Subject: [PATCH] cleaned up comments Signed-off-by: Mikhail Naumov --- .../AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp index 7f3fbbeb38..9f75abb32a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp @@ -367,17 +367,17 @@ namespace AzToolsFramework AZ::EntityId parentId; AZ::Vector3 position = AZ::Vector3::CreateZero(); - // if one entity is selected, set it as parent EntityIdList selectedEntities; ToolsApplicationRequestBus::BroadcastResult(selectedEntities, &ToolsApplicationRequests::GetSelectedEntities); + // if one entity is selected, instantiate prefab as its child and place it at same position as parent if (selectedEntities.size() == 1) { parentId = selectedEntities.front(); AZ::TransformBus::EventResult(position, parentId, &AZ::TransformInterface::GetWorldTranslation); } + // otherwise instantiate it at root level and center of viewport else { - // Get position (center of viewport). If no viewport is available, (0,0,0) will be used. EditorRequestBus::BroadcastResult(position, &EditorRequestBus::Events::GetWorldPositionAtViewportCenter); }