From 612d2b9872fa20762d1b70a6137654f2c01de65a Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 24 Jun 2021 15:14:20 -0500 Subject: [PATCH] [LYN-4782] Make sure Entity notifications are being listened to if a level was already opened before Landscape Canvas was launched. --- Gems/LandscapeCanvas/Code/Source/Editor/MainWindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Gems/LandscapeCanvas/Code/Source/Editor/MainWindow.cpp b/Gems/LandscapeCanvas/Code/Source/Editor/MainWindow.cpp index 24dfcf4ff6..f97d4e913e 100644 --- a/Gems/LandscapeCanvas/Code/Source/Editor/MainWindow.cpp +++ b/Gems/LandscapeCanvas/Code/Source/Editor/MainWindow.cpp @@ -462,6 +462,13 @@ namespace LandscapeCanvasEditor CrySystemEventBus::Handler::BusConnect(); AZ::EntitySystemBus::Handler::BusConnect(); + // Listen for Entity notifications if a level is already loaded + // Otherwise, we will connect/disconnect from this bus when levels are loaded/closed + if (GetLegacyEditor()->IsLevelLoaded()) + { + AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect(); + } + // Create our temporary Node Inspector using a Pinned Inspector m_customNodeInspector = aznew CustomNodeInspectorDockWidget(this);