Change notification buses to be addressed on EntityContextId, and connect the handlers to the default id. Request interfaces should not need that id as they can retrieve it from the entityId.

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
This commit is contained in:
Danilo Aimini
2021-09-28 18:16:02 -07:00
parent ce334f9443
commit c204aa1abe
5 changed files with 40 additions and 9 deletions
@@ -96,6 +96,10 @@ namespace AzToolsFramework::Prefab
else
{
containerEntityId = AZ::EntityId();
// Clear the selection
AzToolsFramework::SelectEntities({});
}
// Focus on the descendants of the container entity
@@ -17,12 +17,19 @@ namespace AzToolsFramework::Prefab
class PrefabFocusNotifications
: public AZ::EBusTraits
{
protected:
~PrefabFocusNotifications() = default;
public:
//////////////////////////////////////////////////////////////////////////
// EBusTraits overrides
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
using BusIdType = AzFramework::EntityContextId;
//////////////////////////////////////////////////////////////////////////
//! Triggered when the editor focus is changed to a different prefab.
virtual void OnPrefabFocusChanged() = 0;
protected:
~PrefabFocusNotifications() = default;
};
using PrefabFocusNotificationBus = AZ::EBus<PrefabFocusNotifications>;