Merge pull request #1568 from aws-lumberyard-dev/cgalvan/CloseGraphOnEntityDelete

[LYN-4782] Make sure Entity notifications are being listened to if a level was already opened before Landscape Canvas was launched.
This commit is contained in:
cgalvan
2021-06-24 16:45:21 -05:00
committed by GitHub
@@ -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);