Fixed entities not being deselected when entering game mode in editor.

added protections around physx AZ::Events handlers that are connected/disconnected on selection events.
jira: LYN-2998
This commit is contained in:
amzn-sean
2021-04-16 18:34:28 +01:00
parent 405276a7ae
commit beafc80939
3 changed files with 20 additions and 5 deletions
@@ -686,8 +686,14 @@ namespace PhysX
{
if (auto* physXSystem = GetPhysXSystem())
{
physXSystem->RegisterSystemConfigurationChangedEvent(m_physXConfigChangedHandler);
physXSystem->RegisterOnDefaultMaterialLibraryChangedEventHandler(m_onDefaultMaterialLibraryChangedEventHandler);
if (!m_physXConfigChangedHandler.IsConnected())
{
physXSystem->RegisterSystemConfigurationChangedEvent(m_physXConfigChangedHandler);
}
if (!m_onDefaultMaterialLibraryChangedEventHandler.IsConnected())
{
physXSystem->RegisterOnDefaultMaterialLibraryChangedEventHandler(m_onDefaultMaterialLibraryChangedEventHandler);
}
}
}