Initialization changes to pass unit tests. Some interfaces are now retrieved on demand and there's clearer failure paths that don't involve asserts to better handle test/headless initializations.

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
This commit is contained in:
Danilo Aimini
2021-09-22 12:44:18 -07:00
parent 834076782f
commit 4ae95719de
7 changed files with 37 additions and 42 deletions
@@ -31,22 +31,18 @@ namespace AzToolsFramework
return IsInFocusSubTree(parentId, focusRootId);
}
FocusModeSystemComponent::~FocusModeSystemComponent()
{
AZ::Interface<FocusModeInterface>::Unregister(this);
}
void FocusModeSystemComponent::Init()
{
AZ::Interface<FocusModeInterface>::Register(this);
}
void FocusModeSystemComponent::Activate()
{
AZ::Interface<FocusModeInterface>::Register(this);
}
void FocusModeSystemComponent::Deactivate()
{
AZ::Interface<FocusModeInterface>::Unregister(this);
}
void FocusModeSystemComponent::Reflect([[maybe_unused]] AZ::ReflectContext* context)
@@ -26,7 +26,7 @@ namespace AzToolsFramework
AZ_COMPONENT(FocusModeSystemComponent, "{6CE522FE-2057-4794-BD05-61E04BD8EA30}");
FocusModeSystemComponent() = default;
virtual ~FocusModeSystemComponent();
virtual ~FocusModeSystemComponent() = default;
// AZ::Component overrides ...
void Init() override;