Prechádzať zdrojové kódy

Added UiElementGroup to LyShine Gem Components. (#19018)

* Added UiElementGroup to LyShine Gem Components.

Introduces a UiComponent that allows for Group handling of states, like rendering, and Interaction, using recursive logic to assure all child elements are disabled.

Signed-off-by: GaianHelmers <[email protected]>

* Updating from feedback. Bringing LyShineModule back to LF after accidental conversion to CRLF. Used .clang-format on cpp

Signed-off-by: GaianHelmers <[email protected]>

* Annoying. The clang format didn't stage with the rest of my commit. Sorry for the extra commit.

Signed-off-by: GaianHelmers <[email protected]>

* Reworked to exclude rendering features, renamed to be the target functionality. The speculated features of fade and rendering are now left back to the element component and fade component.

Signed-off-by: GaianHelmers <[email protected]>

---------

Signed-off-by: GaianHelmers <[email protected]>
GaianHelmers 1 deň pred
rodič
commit
d8bbc3e771

+ 29 - 0
Gems/LyShine/Code/Include/LyShine/Bus/UiHierarchyInteractivityToggleBus.h

@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+#pragma once
+
+#include <AzCore/Component/ComponentBus.h>
+#include <LyShine/UiBase.h>
+
+    // The event bus that interfaces with the UiHierarchyInteractivityToggle Component.
+    // Used to toggle interactivity to the current entity and descendants.
+    class UiHierarchyInteractivityToggleInterface
+        : public AZ::ComponentBus
+    {
+    public:
+        static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
+
+        //Interactive
+        //! The root event call used to manipulate the Interactive state.
+        virtual bool SetInteractivity(bool enabled) = 0;
+        virtual bool SetParentInteractivity(bool parentEnabled) = 0;
+        //! Getter to see the current interactive state.
+        virtual bool GetInteractiveState() = 0;
+    };   
+
+    typedef AZ::EBus<UiHierarchyInteractivityToggleInterface> UiHierarchyInteractivityToggleBus;

+ 2 - 0
Gems/LyShine/Code/Source/LyShineModule.cpp

@@ -46,6 +46,7 @@
 #include "UiDynamicLayoutComponent.h"
 #include "UiDynamicScrollBoxComponent.h"
 #include "UiSpawnerComponent.h"
+#include "UiHierarchyInteractivityToggleComponent.h"
 
 #include "World/UiCanvasAssetRefComponent.h"
 #include "World/UiCanvasProxyRefComponent.h"
@@ -104,6 +105,7 @@ namespace LyShine
                 UiRadioButtonComponent::CreateDescriptor(),
                 UiRadioButtonGroupComponent::CreateDescriptor(),
                 UiParticleEmitterComponent::CreateDescriptor(),
+                UiHierarchyInteractivityToggleComponent::CreateDescriptor(),
     #if defined(LYSHINE_BUILDER)
                 // Builder
                 LyShineBuilder::LyShineBuilderComponent::CreateDescriptor(),

+ 442 - 440
Gems/LyShine/Code/Source/LyShineSystemComponent.cpp

@@ -1,440 +1,442 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#include <AzCore/Serialization/SerializeContext.h>
-#include <AzCore/Serialization/EditContext.h>
-#include <AzCore/Component/ComponentApplicationBus.h>
-#include <AzCore/RTTI/BehaviorContext.h>
-#include "LyShineFeatureProcessor.h"
-#include "LyShineSystemComponent.h"
-#include "UiSerialize.h"
-
-#include "UiCanvasFileObject.h"
-#include "UiCanvasComponent.h"
-#include "LyShineDebug.h"
-#include "UiElementComponent.h"
-#include "UiTransform2dComponent.h"
-#include "UiImageComponent.h"
-#include "UiImageSequenceComponent.h"
-#include "UiTextComponent.h"
-#include "UiButtonComponent.h"
-#include "UiMarkupButtonComponent.h"
-#include "UiCheckboxComponent.h"
-#include "UiDraggableComponent.h"
-#include "UiDropTargetComponent.h"
-#include "UiDropdownComponent.h"
-#include "UiDropdownOptionComponent.h"
-#include "UiSliderComponent.h"
-#include "UiTextInputComponent.h"
-#include "UiScrollBarComponent.h"
-#include "UiScrollBoxComponent.h"
-#include "UiFaderComponent.h"
-#include "UiLayoutFitterComponent.h"
-#include "UiMaskComponent.h"
-#include "UiLayoutCellComponent.h"
-#include "UiLayoutColumnComponent.h"
-#include "UiLayoutRowComponent.h"
-#include "UiLayoutGridComponent.h"
-#include "UiParticleEmitterComponent.h"
-#include "UiFlipbookAnimationComponent.h"
-#include "UiRadioButtonComponent.h"
-#include "UiRadioButtonGroupComponent.h"
-#include "UiTooltipComponent.h"
-#include "UiTooltipDisplayComponent.h"
-#include "UiDynamicLayoutComponent.h"
-#include "UiDynamicScrollBoxComponent.h"
-#include "UiNavigationSettings.h"
-#include "LyShinePass.h"
-
-namespace LyShine
-{
-    const AZStd::list<AZ::ComponentDescriptor*>* LyShineSystemComponent::m_componentDescriptors = nullptr;
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::Reflect(AZ::ReflectContext* context)
-    {
-        UiSerialize::ReflectUiTypes(context);
-        UiCanvasFileObject::Reflect(context);
-        UiNavigationSettings::Reflect(context);
-
-        if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
-        {
-            serialize->Class<LyShineSystemComponent, AZ::Component>()
-                ->Version(1)
-                ->Attribute(AZ::Edit::Attributes::SystemComponentTags, AZStd::vector<AZ::Crc32>({ AZ_CRC_CE("AssetBuilder") }))
-                ->Field("CursorImagePath", &LyShineSystemComponent::m_cursorImagePathname);
-
-            if (AZ::EditContext* ec = serialize->GetEditContext())
-            {
-                auto editInfo = ec->Class<LyShineSystemComponent>("LyShine", "In-game User Interface System");
-                editInfo->ClassElement(AZ::Edit::ClassElements::EditorData, "")
-                    ->Attribute(AZ::Edit::Attributes::Category, "UI")
-                    ->Attribute(AZ::Edit::Attributes::AutoExpand, true);
-
-                editInfo->DataElement(0, &LyShineSystemComponent::m_cursorImagePathname, "CursorImagePath", "The cursor image path.")
-                    ->Attribute(AZ::Edit::Attributes::ChangeNotify, &LyShineSystemComponent::BroadcastCursorImagePathname);
-            }
-        }
-
-        if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
-        {
-            behaviorContext->EBus<UiCanvasManagerBus>("UiCanvasManagerBus")
-                ->Event("CreateCanvas", &UiCanvasManagerBus::Events::CreateCanvas)
-                ->Event("LoadCanvas", &UiCanvasManagerBus::Events::LoadCanvas)
-                ->Event("UnloadCanvas", &UiCanvasManagerBus::Events::UnloadCanvas)
-                ->Event("FindLoadedCanvasByPathName", &UiCanvasManagerBus::Events::FindLoadedCanvasByPathName)
-            ;
-
-            behaviorContext->EBus<UiCursorBus>("UiCursorBus")
-                ->Event("IncrementVisibleCounter", &UiCursorBus::Events::IncrementVisibleCounter)
-                ->Event("DecrementVisibleCounter", &UiCursorBus::Events::DecrementVisibleCounter)
-                ->Event("IsUiCursorVisible", &UiCursorBus::Events::IsUiCursorVisible)
-                ->Event("SetUiCursor", &UiCursorBus::Events::SetUiCursor)
-                ->Event("GetUiCursorPosition", &UiCursorBus::Events::GetUiCursorPosition)
-                ->Event("SetUiCursorPosition", &UiCursorBus::Events::SetUiCursorPosition)
-                ;
-        }
-        
-        LyShineFeatureProcessor::Reflect(context);
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
-    {
-        provided.push_back(AZ_CRC_CE("LyShineService"));
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
-    {
-        incompatible.push_back(AZ_CRC_CE("LyShineService"));
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
-    {
-#if !defined(LYSHINE_BUILDER) && !defined(LYSHINE_TESTS)
-        required.push_back(AZ_CRC_CE("RPISystem"));
-#endif
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent)
-    {
-        dependent.push_back(AZ_CRC_CE("AssetDatabaseService"));
-        dependent.push_back(AZ_CRC_CE("AssetCatalogService"));
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::SetLyShineComponentDescriptors(const AZStd::list<AZ::ComponentDescriptor*>* descriptors)
-    {
-        m_componentDescriptors = descriptors;
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    LyShineSystemComponent::LyShineSystemComponent()
-    {
-        m_cursorImagePathname.SetAssetPath("Textures/Cursor_Default.tif");
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::Init()
-    {
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::Activate()
-    {
-        UiSystemBus::Handler::BusConnect();
-        UiSystemToolsBus::Handler::BusConnect();
-        UiFrameworkBus::Handler::BusConnect();
-        CrySystemEventBus::Handler::BusConnect();
-
-        // register all the component types internal to the LyShine module
-        // These are registered in the order we want them to appear in the Add Component menu
-        RegisterComponentTypeForMenuOrdering(UiCanvasComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiElementComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiTransform2dComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiImageComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiImageSequenceComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiTextComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiButtonComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiMarkupButtonComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiCheckboxComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiRadioButtonComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiRadioButtonGroupComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiSliderComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiTextInputComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiScrollBarComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiScrollBoxComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiDraggableComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiDropTargetComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiDropdownComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiDropdownOptionComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiFaderComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiMaskComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiLayoutColumnComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiLayoutRowComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiLayoutGridComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiLayoutCellComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiLayoutFitterComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiTooltipComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiTooltipDisplayComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiDynamicLayoutComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiDynamicScrollBoxComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiParticleEmitterComponent::RTTI_Type());
-        RegisterComponentTypeForMenuOrdering(UiFlipbookAnimationComponent::RTTI_Type());
-
-#if !defined(LYSHINE_BUILDER) && !defined(LYSHINE_TESTS)
-        // Add LyShine pass
-        auto* passSystem = AZ::RPI::PassSystemInterface::Get();
-        AZ_Assert(passSystem, "Cannot get the pass system.");
-        passSystem->AddPassCreator(AZ::Name("LyShinePass"), &LyShine::LyShinePass::Create);
-        passSystem->AddPassCreator(AZ::Name("LyShineChildPass"), &LyShine::LyShineChildPass::Create);
-        passSystem->AddPassCreator(AZ::Name("RttChildPass"), &LyShine::RttChildPass::Create);
-
-        // Setup handler for load pass template mappings
-        m_loadTemplatesHandler = AZ::RPI::PassSystemInterface::OnReadyLoadTemplatesEvent::Handler([this]() { this->LoadPassTemplateMappings(); });
-        AZ::RPI::PassSystemInterface::Get()->ConnectEvent(m_loadTemplatesHandler);
-        
-        // Register feature processor
-        AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessor<LyShineFeatureProcessor>();
-#endif
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::Deactivate()
-    {
-#if !defined(LYSHINE_BUILDER) && !defined(LYSHINE_TESTS)
-        m_loadTemplatesHandler.Disconnect();        
-        AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<LyShineFeatureProcessor>();
-#endif
-
-        UiSystemBus::Handler::BusDisconnect();
-        UiSystemToolsBus::Handler::BusDisconnect();
-        UiFrameworkBus::Handler::BusDisconnect();
-        CrySystemEventBus::Handler::BusDisconnect();
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::RegisterComponentTypeForMenuOrdering(const AZ::Uuid& typeUuid)
-    {
-        m_componentTypes.push_back(typeUuid);
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    const AZStd::vector<AZ::Uuid>* LyShineSystemComponent::GetComponentTypesForMenuOrdering()
-    {
-        return &m_componentTypes;
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    const AZStd::list<AZ::ComponentDescriptor*>* LyShineSystemComponent::GetLyShineComponentDescriptors()
-    {
-        return m_componentDescriptors;
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    UiSystemToolsInterface::CanvasAssetHandle* LyShineSystemComponent::LoadCanvasFromStream(AZ::IO::GenericStream& stream, const AZ::ObjectStream::FilterDescriptor& filterDesc)
-    {
-        return UiCanvasFileObject::LoadCanvasFromStream(stream, filterDesc);
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::SaveCanvasToStream(UiSystemToolsInterface::CanvasAssetHandle* canvas, AZ::IO::FileIOStream& stream)
-    {
-        UiCanvasFileObject* canvasFileObject = static_cast<UiCanvasFileObject*>(canvas);
-        UiCanvasFileObject::SaveCanvasToStream(stream, canvasFileObject);
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    AZ::Entity* LyShineSystemComponent::GetRootSliceEntity(CanvasAssetHandle* canvas)
-    {
-        UiCanvasFileObject* canvasFileObject = static_cast<UiCanvasFileObject*>(canvas);
-        return canvasFileObject->m_rootSliceEntity;
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    AZ::Entity* LyShineSystemComponent::GetCanvasEntity(CanvasAssetHandle* canvas)
-    {
-        UiCanvasFileObject* canvasFileObject = static_cast<UiCanvasFileObject*>(canvas);
-        return canvasFileObject->m_canvasEntity;
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    AZ::SliceComponent* LyShineSystemComponent::GetRootSliceSliceComponent(UiSystemToolsInterface::CanvasAssetHandle* canvas)
-    {
-        UiCanvasFileObject* canvasFileObject = static_cast<UiCanvasFileObject*>(canvas);
-        AZ::Entity* rootSliceEntity = canvasFileObject->m_rootSliceEntity;
-
-        if (rootSliceEntity->GetState() == AZ::Entity::State::Constructed)
-        {
-            rootSliceEntity->Init();
-        }
-
-        AZ::SliceComponent* sliceComponent = rootSliceEntity->FindComponent<AZ::SliceComponent>();
-        return sliceComponent;
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::ReplaceRootSliceSliceComponent(UiSystemToolsInterface::CanvasAssetHandle* canvas, AZ::SliceComponent* newSliceComponent)
-    {
-        UiCanvasFileObject* canvasFileObject = static_cast<UiCanvasFileObject*>(canvas);
-        AZ::Entity* oldRootSliceEntity = canvasFileObject->m_rootSliceEntity;
-        AZ::EntityId idToReuse = oldRootSliceEntity->GetId();
-        
-        AZ::Entity* newRootSliceEntity = aznew AZ::Entity(idToReuse, AZStd::to_string(static_cast<AZ::u64>(idToReuse)).c_str());
-        newRootSliceEntity->AddComponent(newSliceComponent);
-        canvasFileObject->m_rootSliceEntity = newRootSliceEntity;
-
-        delete oldRootSliceEntity;
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::ReplaceCanvasEntity(UiSystemToolsInterface::CanvasAssetHandle* canvas, AZ::Entity* newCanvasEntity)
-    {
-        UiCanvasFileObject* canvasFileObject = static_cast<UiCanvasFileObject*>(canvas);
-        canvasFileObject->m_canvasEntity = newCanvasEntity;
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::DestroyCanvas(CanvasAssetHandle* canvas)
-    {
-        UiCanvasFileObject* canvasFileObject = static_cast<UiCanvasFileObject*>(canvas);
-        delete canvasFileObject->m_canvasEntity;
-        delete canvasFileObject->m_rootSliceEntity;
-        delete canvasFileObject;
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    bool LyShineSystemComponent::HasUiElementComponent(AZ::Entity* entity)
-    {
-        return entity->FindComponent<UiElementComponent>() != nullptr;
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::AddEditorOnlyEntity(AZ::Entity* editorOnlyEntity, EntityIdSet& editorOnlyEntities)
-    {
-        // All descendents of an editor-only entity are considered editor-only also.
-        // Iterate through all the descedents of the given entity and add their IDs
-        // to the list of editor-only entities.
-        AZStd::vector<AZ::Entity*> childEntities = { editorOnlyEntity };
-        while (!childEntities.empty())
-        {
-            AZ::Entity* parentEntity = childEntities.back();
-            childEntities.pop_back();
-            editorOnlyEntities.insert(parentEntity->GetId());
-
-            UiElementComponent* elementComponent = parentEntity->FindComponent<UiElementComponent>();
-            if (elementComponent)
-            {
-                int numChildren = elementComponent->GetNumChildElements();
-                for (int i = 0; i < numChildren; ++i)
-                {
-                    childEntities.push_back(elementComponent->GetChildElement(i));
-                }
-            }
-        }
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::HandleEditorOnlyEntities(const EntityList& exportSliceEntities, const EntityIdSet& editorOnlyEntityIds)
-    {
-        AZStd::unordered_map<AZ::EntityId, AZStd::vector<AZ::EntityId>> parentToChildren;
-
-        // Build a map of entity Ids to their parent Ids, for faster lookup during processing.
-        for (AZ::Entity* exportParentEntity : exportSliceEntities)
-        {
-            UiElementComponent* exportParentComponent = exportParentEntity->FindComponent<UiElementComponent>();
-            if (!exportParentComponent)
-            {
-                continue;
-            }
-
-            // Map the child entities to the parent ID
-            int numChildElements = exportParentComponent->GetNumChildElements();
-            for (int exportChildIndex = 0; exportChildIndex < numChildElements; ++exportChildIndex)
-            {
-                AZ::EntityId childExportEntity = exportParentComponent->GetChildEntityId(exportChildIndex);
-                parentToChildren[exportParentEntity->GetId()].push_back(childExportEntity);
-            }
-        }
-
-        // Remove editor-only entities from parent hierarchy
-        for (AZ::Entity* exportParentEntity : exportSliceEntities)
-        {
-            for (AZ::EntityId exportChildEntity : parentToChildren[exportParentEntity->GetId()])
-            {
-                const bool childIsEditorOnly = editorOnlyEntityIds.end() != editorOnlyEntityIds.find(exportChildEntity);
-                if (childIsEditorOnly)
-                {
-                    UiElementComponent* exportParentComponent = exportParentEntity->FindComponent<UiElementComponent>();
-                    exportParentComponent->RemoveChild(exportChildEntity);
-                }
-            }
-        }
-    }
-
-    ///////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::OnCrySystemInitialized(ISystem& system, [[maybe_unused]] const SSystemInitParams& startupParams)
-    {
-#if !defined(AZ_MONOLITHIC_BUILD)
-        // When module is linked dynamically, we must set our gEnv pointer.
-        // When module is linked statically, we'll share the application's gEnv pointer.
-        gEnv = system.GetGlobalEnvironment();
-#endif
-        m_lyShine = AZStd::make_unique<CLyShine>();
-        AZ::Interface<ILyShine>::Register(m_lyShine.get());
-
-        system.GetILevelSystem()->AddListener(this);
-
-        BroadcastCursorImagePathname();
-
-        if (AZ::Interface<ILyShine>::Get())
-        {
-            AZ::Interface<ILyShine>::Get()->PostInit();
-        }
-    }
-
-    ///////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::OnCrySystemShutdown(ISystem& system)
-    {
-        system.GetILevelSystem()->RemoveListener(this);
-
-        if (m_lyShine)
-        {
-            AZ::Interface<ILyShine>::Unregister(m_lyShine.get());
-            m_lyShine.reset();
-        }
-    }
-
-    ////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::OnUnloadComplete([[maybe_unused]] const char* levelName)
-    {
-        // Perform level unload procedures for the LyShine UI system
-        if (AZ::Interface<ILyShine>::Get())
-        {
-            AZ::Interface<ILyShine>::Get()->OnLevelUnload();
-        }
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::BroadcastCursorImagePathname()
-    {
-        UiCursorBus::Broadcast(&UiCursorInterface::SetUiCursor, m_cursorImagePathname.GetAssetPath().c_str());
-    }
-
-#if !defined(LYSHINE_BUILDER) && !defined(LYSHINE_TESTS)
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::LoadPassTemplateMappings()
-    {
-        const char* passTemplatesFile = "Passes/LyShinePassTemplates.azasset";
-        AZ::RPI::PassSystemInterface::Get()->LoadPassTemplateMappings(passTemplatesFile);
-    }
-#endif
-}
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#include <AzCore/Serialization/SerializeContext.h>
+#include <AzCore/Serialization/EditContext.h>
+#include <AzCore/Component/ComponentApplicationBus.h>
+#include <AzCore/RTTI/BehaviorContext.h>
+#include "LyShineFeatureProcessor.h"
+#include "LyShineSystemComponent.h"
+#include "UiSerialize.h"
+
+#include "UiCanvasFileObject.h"
+#include "UiCanvasComponent.h"
+#include "LyShineDebug.h"
+#include "UiElementComponent.h"
+#include "UiHierarchyInteractivityToggleComponent.h"
+#include "UiTransform2dComponent.h"
+#include "UiImageComponent.h"
+#include "UiImageSequenceComponent.h"
+#include "UiTextComponent.h"
+#include "UiButtonComponent.h"
+#include "UiMarkupButtonComponent.h"
+#include "UiCheckboxComponent.h"
+#include "UiDraggableComponent.h"
+#include "UiDropTargetComponent.h"
+#include "UiDropdownComponent.h"
+#include "UiDropdownOptionComponent.h"
+#include "UiSliderComponent.h"
+#include "UiTextInputComponent.h"
+#include "UiScrollBarComponent.h"
+#include "UiScrollBoxComponent.h"
+#include "UiFaderComponent.h"
+#include "UiLayoutFitterComponent.h"
+#include "UiMaskComponent.h"
+#include "UiLayoutCellComponent.h"
+#include "UiLayoutColumnComponent.h"
+#include "UiLayoutRowComponent.h"
+#include "UiLayoutGridComponent.h"
+#include "UiParticleEmitterComponent.h"
+#include "UiFlipbookAnimationComponent.h"
+#include "UiRadioButtonComponent.h"
+#include "UiRadioButtonGroupComponent.h"
+#include "UiTooltipComponent.h"
+#include "UiTooltipDisplayComponent.h"
+#include "UiDynamicLayoutComponent.h"
+#include "UiDynamicScrollBoxComponent.h"
+#include "UiNavigationSettings.h"
+#include "LyShinePass.h"
+
+namespace LyShine
+{
+    const AZStd::list<AZ::ComponentDescriptor*>* LyShineSystemComponent::m_componentDescriptors = nullptr;
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::Reflect(AZ::ReflectContext* context)
+    {
+        UiSerialize::ReflectUiTypes(context);
+        UiCanvasFileObject::Reflect(context);
+        UiNavigationSettings::Reflect(context);
+
+        if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
+        {
+            serialize->Class<LyShineSystemComponent, AZ::Component>()
+                ->Version(1)
+                ->Attribute(AZ::Edit::Attributes::SystemComponentTags, AZStd::vector<AZ::Crc32>({ AZ_CRC_CE("AssetBuilder") }))
+                ->Field("CursorImagePath", &LyShineSystemComponent::m_cursorImagePathname);
+
+            if (AZ::EditContext* ec = serialize->GetEditContext())
+            {
+                auto editInfo = ec->Class<LyShineSystemComponent>("LyShine", "In-game User Interface System");
+                editInfo->ClassElement(AZ::Edit::ClassElements::EditorData, "")
+                    ->Attribute(AZ::Edit::Attributes::Category, "UI")
+                    ->Attribute(AZ::Edit::Attributes::AutoExpand, true);
+
+                editInfo->DataElement(0, &LyShineSystemComponent::m_cursorImagePathname, "CursorImagePath", "The cursor image path.")
+                    ->Attribute(AZ::Edit::Attributes::ChangeNotify, &LyShineSystemComponent::BroadcastCursorImagePathname);
+            }
+        }
+
+        if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
+        {
+            behaviorContext->EBus<UiCanvasManagerBus>("UiCanvasManagerBus")
+                ->Event("CreateCanvas", &UiCanvasManagerBus::Events::CreateCanvas)
+                ->Event("LoadCanvas", &UiCanvasManagerBus::Events::LoadCanvas)
+                ->Event("UnloadCanvas", &UiCanvasManagerBus::Events::UnloadCanvas)
+                ->Event("FindLoadedCanvasByPathName", &UiCanvasManagerBus::Events::FindLoadedCanvasByPathName)
+            ;
+
+            behaviorContext->EBus<UiCursorBus>("UiCursorBus")
+                ->Event("IncrementVisibleCounter", &UiCursorBus::Events::IncrementVisibleCounter)
+                ->Event("DecrementVisibleCounter", &UiCursorBus::Events::DecrementVisibleCounter)
+                ->Event("IsUiCursorVisible", &UiCursorBus::Events::IsUiCursorVisible)
+                ->Event("SetUiCursor", &UiCursorBus::Events::SetUiCursor)
+                ->Event("GetUiCursorPosition", &UiCursorBus::Events::GetUiCursorPosition)
+                ->Event("SetUiCursorPosition", &UiCursorBus::Events::SetUiCursorPosition)
+                ;
+        }
+        
+        LyShineFeatureProcessor::Reflect(context);
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
+    {
+        provided.push_back(AZ_CRC_CE("LyShineService"));
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
+    {
+        incompatible.push_back(AZ_CRC_CE("LyShineService"));
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
+    {
+#if !defined(LYSHINE_BUILDER) && !defined(LYSHINE_TESTS)
+        required.push_back(AZ_CRC_CE("RPISystem"));
+#endif
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent)
+    {
+        dependent.push_back(AZ_CRC_CE("AssetDatabaseService"));
+        dependent.push_back(AZ_CRC_CE("AssetCatalogService"));
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::SetLyShineComponentDescriptors(const AZStd::list<AZ::ComponentDescriptor*>* descriptors)
+    {
+        m_componentDescriptors = descriptors;
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    LyShineSystemComponent::LyShineSystemComponent()
+    {
+        m_cursorImagePathname.SetAssetPath("Textures/Cursor_Default.tif");
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::Init()
+    {
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::Activate()
+    {
+        UiSystemBus::Handler::BusConnect();
+        UiSystemToolsBus::Handler::BusConnect();
+        UiFrameworkBus::Handler::BusConnect();
+        CrySystemEventBus::Handler::BusConnect();
+
+        // register all the component types internal to the LyShine module
+        // These are registered in the order we want them to appear in the Add Component menu
+        RegisterComponentTypeForMenuOrdering(UiCanvasComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiElementComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiHierarchyInteractivityToggleComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiTransform2dComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiImageComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiImageSequenceComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiTextComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiButtonComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiMarkupButtonComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiCheckboxComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiRadioButtonComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiRadioButtonGroupComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiSliderComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiTextInputComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiScrollBarComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiScrollBoxComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiDraggableComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiDropTargetComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiDropdownComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiDropdownOptionComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiFaderComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiMaskComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiLayoutColumnComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiLayoutRowComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiLayoutGridComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiLayoutCellComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiLayoutFitterComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiTooltipComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiTooltipDisplayComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiDynamicLayoutComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiDynamicScrollBoxComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiParticleEmitterComponent::RTTI_Type());
+        RegisterComponentTypeForMenuOrdering(UiFlipbookAnimationComponent::RTTI_Type());
+
+#if !defined(LYSHINE_BUILDER) && !defined(LYSHINE_TESTS)
+        // Add LyShine pass
+        auto* passSystem = AZ::RPI::PassSystemInterface::Get();
+        AZ_Assert(passSystem, "Cannot get the pass system.");
+        passSystem->AddPassCreator(AZ::Name("LyShinePass"), &LyShine::LyShinePass::Create);
+        passSystem->AddPassCreator(AZ::Name("LyShineChildPass"), &LyShine::LyShineChildPass::Create);
+        passSystem->AddPassCreator(AZ::Name("RttChildPass"), &LyShine::RttChildPass::Create);
+
+        // Setup handler for load pass template mappings
+        m_loadTemplatesHandler = AZ::RPI::PassSystemInterface::OnReadyLoadTemplatesEvent::Handler([this]() { this->LoadPassTemplateMappings(); });
+        AZ::RPI::PassSystemInterface::Get()->ConnectEvent(m_loadTemplatesHandler);
+        
+        // Register feature processor
+        AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessor<LyShineFeatureProcessor>();
+#endif
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::Deactivate()
+    {
+#if !defined(LYSHINE_BUILDER) && !defined(LYSHINE_TESTS)
+        m_loadTemplatesHandler.Disconnect();        
+        AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<LyShineFeatureProcessor>();
+#endif
+
+        UiSystemBus::Handler::BusDisconnect();
+        UiSystemToolsBus::Handler::BusDisconnect();
+        UiFrameworkBus::Handler::BusDisconnect();
+        CrySystemEventBus::Handler::BusDisconnect();
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::RegisterComponentTypeForMenuOrdering(const AZ::Uuid& typeUuid)
+    {
+        m_componentTypes.push_back(typeUuid);
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    const AZStd::vector<AZ::Uuid>* LyShineSystemComponent::GetComponentTypesForMenuOrdering()
+    {
+        return &m_componentTypes;
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    const AZStd::list<AZ::ComponentDescriptor*>* LyShineSystemComponent::GetLyShineComponentDescriptors()
+    {
+        return m_componentDescriptors;
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    UiSystemToolsInterface::CanvasAssetHandle* LyShineSystemComponent::LoadCanvasFromStream(AZ::IO::GenericStream& stream, const AZ::ObjectStream::FilterDescriptor& filterDesc)
+    {
+        return UiCanvasFileObject::LoadCanvasFromStream(stream, filterDesc);
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::SaveCanvasToStream(UiSystemToolsInterface::CanvasAssetHandle* canvas, AZ::IO::FileIOStream& stream)
+    {
+        UiCanvasFileObject* canvasFileObject = static_cast<UiCanvasFileObject*>(canvas);
+        UiCanvasFileObject::SaveCanvasToStream(stream, canvasFileObject);
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    AZ::Entity* LyShineSystemComponent::GetRootSliceEntity(CanvasAssetHandle* canvas)
+    {
+        UiCanvasFileObject* canvasFileObject = static_cast<UiCanvasFileObject*>(canvas);
+        return canvasFileObject->m_rootSliceEntity;
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    AZ::Entity* LyShineSystemComponent::GetCanvasEntity(CanvasAssetHandle* canvas)
+    {
+        UiCanvasFileObject* canvasFileObject = static_cast<UiCanvasFileObject*>(canvas);
+        return canvasFileObject->m_canvasEntity;
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    AZ::SliceComponent* LyShineSystemComponent::GetRootSliceSliceComponent(UiSystemToolsInterface::CanvasAssetHandle* canvas)
+    {
+        UiCanvasFileObject* canvasFileObject = static_cast<UiCanvasFileObject*>(canvas);
+        AZ::Entity* rootSliceEntity = canvasFileObject->m_rootSliceEntity;
+
+        if (rootSliceEntity->GetState() == AZ::Entity::State::Constructed)
+        {
+            rootSliceEntity->Init();
+        }
+
+        AZ::SliceComponent* sliceComponent = rootSliceEntity->FindComponent<AZ::SliceComponent>();
+        return sliceComponent;
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::ReplaceRootSliceSliceComponent(UiSystemToolsInterface::CanvasAssetHandle* canvas, AZ::SliceComponent* newSliceComponent)
+    {
+        UiCanvasFileObject* canvasFileObject = static_cast<UiCanvasFileObject*>(canvas);
+        AZ::Entity* oldRootSliceEntity = canvasFileObject->m_rootSliceEntity;
+        AZ::EntityId idToReuse = oldRootSliceEntity->GetId();
+        
+        AZ::Entity* newRootSliceEntity = aznew AZ::Entity(idToReuse, AZStd::to_string(static_cast<AZ::u64>(idToReuse)).c_str());
+        newRootSliceEntity->AddComponent(newSliceComponent);
+        canvasFileObject->m_rootSliceEntity = newRootSliceEntity;
+
+        delete oldRootSliceEntity;
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::ReplaceCanvasEntity(UiSystemToolsInterface::CanvasAssetHandle* canvas, AZ::Entity* newCanvasEntity)
+    {
+        UiCanvasFileObject* canvasFileObject = static_cast<UiCanvasFileObject*>(canvas);
+        canvasFileObject->m_canvasEntity = newCanvasEntity;
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::DestroyCanvas(CanvasAssetHandle* canvas)
+    {
+        UiCanvasFileObject* canvasFileObject = static_cast<UiCanvasFileObject*>(canvas);
+        delete canvasFileObject->m_canvasEntity;
+        delete canvasFileObject->m_rootSliceEntity;
+        delete canvasFileObject;
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    bool LyShineSystemComponent::HasUiElementComponent(AZ::Entity* entity)
+    {
+        return entity->FindComponent<UiElementComponent>() != nullptr;
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::AddEditorOnlyEntity(AZ::Entity* editorOnlyEntity, EntityIdSet& editorOnlyEntities)
+    {
+        // All descendents of an editor-only entity are considered editor-only also.
+        // Iterate through all the descedents of the given entity and add their IDs
+        // to the list of editor-only entities.
+        AZStd::vector<AZ::Entity*> childEntities = { editorOnlyEntity };
+        while (!childEntities.empty())
+        {
+            AZ::Entity* parentEntity = childEntities.back();
+            childEntities.pop_back();
+            editorOnlyEntities.insert(parentEntity->GetId());
+
+            UiElementComponent* elementComponent = parentEntity->FindComponent<UiElementComponent>();
+            if (elementComponent)
+            {
+                int numChildren = elementComponent->GetNumChildElements();
+                for (int i = 0; i < numChildren; ++i)
+                {
+                    childEntities.push_back(elementComponent->GetChildElement(i));
+                }
+            }
+        }
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::HandleEditorOnlyEntities(const EntityList& exportSliceEntities, const EntityIdSet& editorOnlyEntityIds)
+    {
+        AZStd::unordered_map<AZ::EntityId, AZStd::vector<AZ::EntityId>> parentToChildren;
+
+        // Build a map of entity Ids to their parent Ids, for faster lookup during processing.
+        for (AZ::Entity* exportParentEntity : exportSliceEntities)
+        {
+            UiElementComponent* exportParentComponent = exportParentEntity->FindComponent<UiElementComponent>();
+            if (!exportParentComponent)
+            {
+                continue;
+            }
+
+            // Map the child entities to the parent ID
+            int numChildElements = exportParentComponent->GetNumChildElements();
+            for (int exportChildIndex = 0; exportChildIndex < numChildElements; ++exportChildIndex)
+            {
+                AZ::EntityId childExportEntity = exportParentComponent->GetChildEntityId(exportChildIndex);
+                parentToChildren[exportParentEntity->GetId()].push_back(childExportEntity);
+            }
+        }
+
+        // Remove editor-only entities from parent hierarchy
+        for (AZ::Entity* exportParentEntity : exportSliceEntities)
+        {
+            for (AZ::EntityId exportChildEntity : parentToChildren[exportParentEntity->GetId()])
+            {
+                const bool childIsEditorOnly = editorOnlyEntityIds.end() != editorOnlyEntityIds.find(exportChildEntity);
+                if (childIsEditorOnly)
+                {
+                    UiElementComponent* exportParentComponent = exportParentEntity->FindComponent<UiElementComponent>();
+                    exportParentComponent->RemoveChild(exportChildEntity);
+                }
+            }
+        }
+    }
+
+    ///////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::OnCrySystemInitialized(ISystem& system, [[maybe_unused]] const SSystemInitParams& startupParams)
+    {
+#if !defined(AZ_MONOLITHIC_BUILD)
+        // When module is linked dynamically, we must set our gEnv pointer.
+        // When module is linked statically, we'll share the application's gEnv pointer.
+        gEnv = system.GetGlobalEnvironment();
+#endif
+        m_lyShine = AZStd::make_unique<CLyShine>();
+        AZ::Interface<ILyShine>::Register(m_lyShine.get());
+
+        system.GetILevelSystem()->AddListener(this);
+
+        BroadcastCursorImagePathname();
+
+        if (AZ::Interface<ILyShine>::Get())
+        {
+            AZ::Interface<ILyShine>::Get()->PostInit();
+        }
+    }
+
+    ///////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::OnCrySystemShutdown(ISystem& system)
+    {
+        system.GetILevelSystem()->RemoveListener(this);
+
+        if (m_lyShine)
+        {
+            AZ::Interface<ILyShine>::Unregister(m_lyShine.get());
+            m_lyShine.reset();
+        }
+    }
+
+    ////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::OnUnloadComplete([[maybe_unused]] const char* levelName)
+    {
+        // Perform level unload procedures for the LyShine UI system
+        if (AZ::Interface<ILyShine>::Get())
+        {
+            AZ::Interface<ILyShine>::Get()->OnLevelUnload();
+        }
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::BroadcastCursorImagePathname()
+    {
+        UiCursorBus::Broadcast(&UiCursorInterface::SetUiCursor, m_cursorImagePathname.GetAssetPath().c_str());
+    }
+
+#if !defined(LYSHINE_BUILDER) && !defined(LYSHINE_TESTS)
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::LoadPassTemplateMappings()
+    {
+        const char* passTemplatesFile = "Passes/LyShinePassTemplates.azasset";
+        AZ::RPI::PassSystemInterface::Get()->LoadPassTemplateMappings(passTemplatesFile);
+    }
+#endif
+}

+ 154 - 0
Gems/LyShine/Code/Source/UiHierarchyInteractivityToggleComponent.cpp

@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+#include "UiHierarchyInteractivityToggleComponent.h"
+
+#include <AzCore/RTTI/BehaviorContext.h>
+#include <AzCore/Serialization/EditContext.h>
+#include <AzCore/Serialization/SerializeContext.h>
+
+#include <LyShine/Bus/UiElementBus.h>
+#include <LyShine/Bus/UiInteractableBus.h>
+
+AZ_COMPONENT_IMPL(UiHierarchyInteractivityToggleComponent, "UiHierarchyInteractivityToggleComponent", "{B8C5A864-1A98-48B9-BEBB-1FDE06E6D463}");
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+void UiHierarchyInteractivityToggleComponent::Activate()
+{
+    UiHierarchyInteractivityToggleBus::Handler::BusConnect(GetEntityId());
+    UiInitializationBus::Handler::BusConnect(GetEntityId());
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+void UiHierarchyInteractivityToggleComponent::Deactivate()
+{
+    UiHierarchyInteractivityToggleBus::Handler::BusDisconnect();
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+void UiHierarchyInteractivityToggleComponent::InGamePostActivate()
+{
+    UiInitializationBus::Handler::BusDisconnect();
+
+    if (!m_isInteractionLocallyEnabled)
+    {
+        SetInteractivity(false);
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+bool UiHierarchyInteractivityToggleComponent::SetInteractivity(bool enabled)
+{
+    m_isInteractionLocallyEnabled = enabled;
+    UpdateInteractiveState();
+    return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+bool UiHierarchyInteractivityToggleComponent::SetParentInteractivity(bool parentEnabled)
+{
+    m_isInteractionParentEnabled = parentEnabled;
+    UpdateInteractiveState();
+    return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+void UiHierarchyInteractivityToggleComponent::UpdateInteractiveState()
+{
+    const bool effectiveState = GetInteractiveState();
+
+    // Affect the current entity.
+    UiInteractableBus::Event(GetEntityId(), &UiInteractableInterface::SetIsHandlingEvents, effectiveState);
+    UiInteractableBus::Event(GetEntityId(), &UiInteractableInterface::SetIsHandlingMultiTouchEvents, effectiveState);
+
+    DoRecursiveSetInteractivityToChildren(GetEntityId(), effectiveState);
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+void UiHierarchyInteractivityToggleComponent::DoRecursiveSetInteractivityToChildren(const AZ::EntityId& parentId, bool parentState)
+{
+    AZStd::vector<AZ::EntityId> children;
+    UiElementBus::EventResult(children, parentId, &UiElementInterface::GetChildEntityIds);
+
+    for (const AZ::EntityId& child : children)
+    {
+        // If has InteractivityToggleComp, will return true;
+        bool hasGroup = false;
+        UiHierarchyInteractivityToggleBus::EventResult(hasGroup, child, &UiHierarchyInteractivityToggleInterface::SetParentInteractivity, parentState);
+
+        // Because no toggle found, affect child and recurse.
+        if (!hasGroup)
+        {
+            // Affect interactable state directly
+            UiInteractableBus::Event(child, &UiInteractableInterface::SetIsHandlingEvents, parentState);
+            UiInteractableBus::Event(child, &UiInteractableInterface::SetIsHandlingMultiTouchEvents, parentState);
+
+            // Recurse into this child's children
+            DoRecursiveSetInteractivityToChildren(child, parentState);
+        }
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+void UiHierarchyInteractivityToggleComponent::Reflect(AZ::ReflectContext* context)
+{
+    if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
+    {
+        serializeContext->Class<UiHierarchyInteractivityToggleComponent, AZ::Component>()
+            ->Version(1)
+            ->Field("LocalInteraction", &UiHierarchyInteractivityToggleComponent::m_isInteractionLocallyEnabled)
+            ;
+
+        if (AZ::EditContext* editContext = serializeContext->GetEditContext())
+        {
+            editContext
+                ->Class<UiHierarchyInteractivityToggleComponent>(
+                    "HierarchyInteractivityToggle", "A grouping handler that allows interaction and rendering for the entire hierarchy of children.")
+                ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
+                ->Attribute(AZ::Edit::Attributes::Category, "UI")
+                ->Attribute(AZ::Edit::Attributes::Icon, "Icons/Components/Component_Placeholder.svg")
+                ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("UI"))
+                ->DataElement(
+                    AZ::Edit::UIHandlers::Default,
+                    &UiHierarchyInteractivityToggleComponent::m_isInteractionLocallyEnabled,
+                    "Is Interactive",
+                    "Whether this entity and children will be interactable.")
+                    ;
+        }
+    }
+
+    if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
+    {
+        behaviorContext->EBus<UiHierarchyInteractivityToggleBus>("UiHierarchyInteractivityToggleBus")
+            ->Event("Set Interactive State", &UiHierarchyInteractivityToggleInterface::SetInteractivity)
+            ->Event("Get Interactive State", &UiHierarchyInteractivityToggleInterface::GetInteractiveState)
+            ;
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+void UiHierarchyInteractivityToggleComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
+{
+    provided.push_back(AZ_CRC_CE("UiHierarchyInteractivityToggleComponentService"));
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+void UiHierarchyInteractivityToggleComponent::GetIncompatibleServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& incompatible)
+{
+    incompatible.push_back(AZ_CRC_CE("UiHierarchyInteractivityToggleComponentService"));
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+void UiHierarchyInteractivityToggleComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
+{
+    required.push_back(AZ_CRC_CE("UiElementService"));
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+void UiHierarchyInteractivityToggleComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent)
+{
+}

+ 52 - 0
Gems/LyShine/Code/Source/UiHierarchyInteractivityToggleComponent.h

@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+#pragma once
+
+#include <LyShine/Bus/UiHierarchyInteractivityToggleBus.h>
+
+#include <AzCore/Component/Component.h>
+#include <LyShine/Bus/UiInitializationBus.h>
+
+class UiHierarchyInteractivityToggleComponent
+    : public AZ::Component
+    , public UiInitializationBus::Handler
+    , public UiHierarchyInteractivityToggleBus::Handler
+{
+    public:
+        AZ_COMPONENT_DECL(UiHierarchyInteractivityToggleComponent);
+        
+        static void Reflect(AZ::ReflectContext* context);
+        static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
+        static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
+        static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
+        static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
+        
+        //UiInitializationBus::Handler overrides..
+        void InGamePostActivate() override;
+        //~UiInitializationBus::Handler overrides...
+        
+        //UiHierarchyInteractivityToggleBus::Handler overrides..
+        //! The root Method call used to manipulate the Interactive state.
+        bool SetInteractivity(bool enabled) override;
+        bool SetParentInteractivity(bool parentEnabled) override; //Used for child propagation.
+        //! Getter to see the current interactive state.
+        bool GetInteractiveState() override { return m_isInteractionLocallyEnabled && m_isInteractionParentEnabled; };
+        //~UiHierarchyInteractivityToggleBus::Handler overrides...
+    
+        //Local Methods.
+        void UpdateInteractiveState();
+        void DoRecursiveSetInteractivityToChildren(const AZ::EntityId& parentId, bool parentState);
+
+        void Activate() override;
+        void Deactivate() override;
+
+    protected:
+        //State
+        bool m_isInteractionLocallyEnabled = true;
+        bool m_isInteractionParentEnabled = true;
+};

+ 255 - 252
Gems/LyShine/Code/lyshine_static_files.cmake

@@ -1,252 +1,255 @@
-#
-# Copyright (c) Contributors to the Open 3D Engine Project.
-# For complete copyright and license terms please see the LICENSE at the root of this distribution.
-#
-# SPDX-License-Identifier: Apache-2.0 OR MIT
-#
-#
-
-set(FILES
-    Include/LyShine/IDraw2d.h
-    Include/LyShine/IRenderGraph.h
-    Include/LyShine/ISprite.h
-    Include/LyShine/ILyShine.h
-    Include/LyShine/UiAssetTypes.h
-    Include/LyShine/UiBase.h
-    Include/LyShine/UiLayoutCellBase.h
-    Include/LyShine/UiSerializeHelpers.h
-    Include/LyShine/UiComponentTypes.h
-    Include/LyShine/UiEntityContext.h
-    Include/LyShine/UiEditorDLLBus.h
-    Include/LyShine/UiRenderFormats.h
-    Include/LyShine/Animation/IUiAnimation.h
-    Include/LyShine/Bus/UiAnimationBus.h
-    Include/LyShine/Bus/UiAnimateEntityBus.h
-    Include/LyShine/Bus/UiButtonBus.h
-    Include/LyShine/Bus/UiCanvasBus.h
-    Include/LyShine/Bus/UiCanvasManagerBus.h
-    Include/LyShine/Bus/UiCanvasUpdateNotificationBus.h
-    Include/LyShine/Bus/UiCheckboxBus.h
-    Include/LyShine/Bus/UiCursorBus.h
-    Include/LyShine/Bus/UiDraggableBus.h
-    Include/LyShine/Bus/UiDropdownBus.h
-    Include/LyShine/Bus/UiDropdownOptionBus.h
-    Include/LyShine/Bus/UiDropTargetBus.h
-    Include/LyShine/Bus/UiDynamicLayoutBus.h
-    Include/LyShine/Bus/UiDynamicScrollBoxBus.h
-    Include/LyShine/Bus/UiEditorBus.h
-    Include/LyShine/Bus/UiEditorCanvasBus.h
-    Include/LyShine/Bus/UiEditorChangeNotificationBus.h
-    Include/LyShine/Bus/UiElementBus.h
-    Include/LyShine/Bus/UiEntityContextBus.h
-    Include/LyShine/Bus/UiFaderBus.h
-    Include/LyShine/Bus/UiFlipbookAnimationBus.h
-    Include/LyShine/Bus/UiGameEntityContextBus.h
-    Include/LyShine/Bus/UiImageBus.h
-    Include/LyShine/Bus/UiImageSequenceBus.h
-    Include/LyShine/Bus/UiIndexableImageBus.h
-    Include/LyShine/Bus/UiInitializationBus.h
-    Include/LyShine/Bus/UiInteractableActionsBus.h
-    Include/LyShine/Bus/UiInteractableBus.h
-    Include/LyShine/Bus/UiInteractableStatesBus.h
-    Include/LyShine/Bus/UiInteractionMaskBus.h
-    Include/LyShine/Bus/UiLayoutBus.h
-    Include/LyShine/Bus/UiLayoutCellBus.h
-    Include/LyShine/Bus/UiLayoutCellDefaultBus.h
-    Include/LyShine/Bus/UiLayoutColumnBus.h
-    Include/LyShine/Bus/UiLayoutControllerBus.h
-    Include/LyShine/Bus/UiLayoutFitterBus.h
-    Include/LyShine/Bus/UiLayoutGridBus.h
-    Include/LyShine/Bus/UiLayoutManagerBus.h
-    Include/LyShine/Bus/UiLayoutRowBus.h
-    Include/LyShine/Bus/UiMarkupButtonBus.h
-    Include/LyShine/Bus/UiMaskBus.h
-    Include/LyShine/Bus/UiNavigationBus.h
-    Include/LyShine/Bus/UiParticleEmitterBus.h
-    Include/LyShine/Bus/UiRadioButtonBus.h
-    Include/LyShine/Bus/UiRadioButtonCommunicationBus.h
-    Include/LyShine/Bus/UiRadioButtonGroupBus.h
-    Include/LyShine/Bus/UiRadioButtonGroupCommunicationBus.h
-    Include/LyShine/Bus/UiRenderBus.h
-    Include/LyShine/Bus/UiRenderControlBus.h
-    Include/LyShine/Bus/UiScrollableBus.h
-    Include/LyShine/Bus/UiScrollBarBus.h
-    Include/LyShine/Bus/UiScrollBoxBus.h
-    Include/LyShine/Bus/UiScrollerBus.h
-    Include/LyShine/Bus/UiSliderBus.h
-    Include/LyShine/Bus/UiSpawnerBus.h
-    Include/LyShine/Bus/UiSystemBus.h
-    Include/LyShine/Bus/UiTextBus.h
-    Include/LyShine/Bus/UiTextInputBus.h
-    Include/LyShine/Bus/UiTooltipBus.h
-    Include/LyShine/Bus/UiTooltipDataPopulatorBus.h
-    Include/LyShine/Bus/UiTooltipDisplayBus.h
-    Include/LyShine/Bus/UiTransform2dBus.h
-    Include/LyShine/Bus/UiTransformBus.h
-    Include/LyShine/Bus/UiVisualBus.h
-    Include/LyShine/Bus/Sprite/UiSpriteBus.h
-    Include/LyShine/Bus/World/UiCanvasOnMeshBus.h
-    Include/LyShine/Bus/World/UiCanvasRefBus.h
-    Include/LyShine/Bus/Tools/UiSystemToolsBus.h
-    Source/Draw2d.cpp
-    Source/Draw2d.h
-    Source/LyShine.cpp
-    Source/LyShine.h
-    Source/LyShinePassDataBus.h
-    Source/LyShineDebug.cpp
-    Source/LyShineDebug.h
-    Source/LyShineFeatureProcessor.cpp
-    Source/LyShineFeatureProcessor.h
-    Source/LyShinePass.cpp
-    Source/LyShinePass.h
-    Source/StringUtfUtils.h
-    Source/UiImageComponent.cpp
-    Source/UiImageComponent.h
-    Source/UiImageSequenceComponent.cpp
-    Source/UiImageSequenceComponent.h
-    Source/UiRenderer.cpp
-    Source/UiRenderer.h
-    Include/LyShine/LyShineBus.h
-    Source/EditorPropertyTypes.cpp
-    Source/EditorPropertyTypes.h
-    Source/LyShineLoadScreen.cpp
-    Source/LyShineLoadScreen.h
-    Source/RenderGraph.cpp
-    Source/RenderGraph.h
-    Source/RenderToTextureBus.h
-    Source/TextMarkup.cpp
-    Source/TextMarkup.h
-    Source/UiButtonComponent.cpp
-    Source/UiButtonComponent.h
-    Source/UiCanvasComponent.cpp
-    Source/UiCanvasComponent.h
-    Source/UiCanvasFileObject.cpp
-    Source/UiCanvasFileObject.h
-    Source/UiCanvasManager.cpp
-    Source/UiCanvasManager.h
-    Source/UiCheckboxComponent.cpp
-    Source/UiCheckboxComponent.h
-    Source/UiDraggableComponent.cpp
-    Source/UiDraggableComponent.h
-    Source/UiDropTargetComponent.cpp
-    Source/UiDropTargetComponent.h
-    Source/UiDropdownComponent.cpp
-    Source/UiDropdownComponent.h
-    Source/UiDropdownOptionComponent.cpp
-    Source/UiDropdownOptionComponent.h
-    Source/UiDynamicLayoutComponent.cpp
-    Source/UiDynamicLayoutComponent.h
-    Source/UiDynamicScrollBoxComponent.cpp
-    Source/UiDynamicScrollBoxComponent.h
-    Source/UiElementComponent.cpp
-    Source/UiElementComponent.h
-    Source/UiFaderComponent.cpp
-    Source/UiFaderComponent.h
-    Source/UiFlipbookAnimationComponent.cpp
-    Source/UiFlipbookAnimationComponent.h
-    Source/UiGameEntityContext.cpp
-    Source/UiGameEntityContext.h
-    Source/UiInteractableComponent.cpp
-    Source/UiInteractableComponent.h
-    Source/UiInteractableState.cpp
-    Source/UiInteractableState.h
-    Source/UiLayoutCellComponent.cpp
-    Source/UiLayoutCellComponent.h
-    Source/UiLayoutColumnComponent.cpp
-    Source/UiLayoutColumnComponent.h
-    Source/UiLayoutFitterComponent.cpp
-    Source/UiLayoutFitterComponent.h
-    Source/UiLayoutGridComponent.cpp
-    Source/UiLayoutGridComponent.h
-    Source/UiLayoutHelpers.cpp
-    Source/UiLayoutHelpers.h
-    Source/UiLayoutManager.cpp
-    Source/UiLayoutManager.h
-    Source/UiLayoutRowComponent.cpp
-    Source/UiLayoutRowComponent.h
-    Source/UiMarkupButtonComponent.cpp
-    Source/UiMarkupButtonComponent.h
-    Source/UiMaskComponent.cpp
-    Source/UiMaskComponent.h
-    Source/UiNavigationHelpers.cpp
-    Source/UiNavigationHelpers.h
-    Source/UiNavigationSettings.cpp
-    Source/UiNavigationSettings.h
-    Source/UiParticleEmitterComponent.cpp
-    Source/UiParticleEmitterComponent.h
-    Source/UiRadioButtonComponent.cpp
-    Source/UiRadioButtonComponent.h
-    Source/UiRadioButtonGroupComponent.cpp
-    Source/UiRadioButtonGroupComponent.h
-    Source/UiScrollBarComponent.cpp
-    Source/UiScrollBarComponent.h
-    Source/UiScrollBoxComponent.cpp
-    Source/UiScrollBoxComponent.h
-    Source/UiSerialize.cpp
-    Source/UiSerialize.h
-    Source/UiSliderComponent.cpp
-    Source/UiSliderComponent.h
-    Source/UiStateActionManager.cpp
-    Source/UiStateActionManager.h
-    Source/UiSpawnerComponent.cpp
-    Source/UiSpawnerComponent.h
-    Source/UiTextComponent.cpp
-    Source/UiTextComponent.h
-    Source/UiTextComponentOffsetsSelector.cpp
-    Source/UiTextComponentOffsetsSelector.h
-    Source/UiTextInputComponent.cpp
-    Source/UiTextInputComponent.h
-    Source/UiTooltipComponent.cpp
-    Source/UiTooltipComponent.h
-    Source/UiTooltipDisplayComponent.cpp
-    Source/UiTooltipDisplayComponent.h
-    Source/UiTransform2dComponent.cpp
-    Source/UiTransform2dComponent.h
-    Source/UiClipboard.h
-    Source/Sprite.cpp
-    Source/Sprite.h
-    Source/Animation/2DSpline.h
-    Source/Animation/AnimNode.cpp
-    Source/Animation/AnimNode.h
-    Source/Animation/AnimSequence.cpp
-    Source/Animation/AnimSequence.h
-    Source/Animation/AnimSplineTrack.h
-    Source/Animation/AnimSplineTrack_Vec2Specialization.cpp
-    Source/Animation/AnimTrack.h
-    Source/Animation/AzEntityNode.cpp
-    Source/Animation/AzEntityNode.h
-    Source/Animation/BoolTrack.cpp
-    Source/Animation/BoolTrack.h
-    Source/Animation/CompoundSplineTrack.cpp
-    Source/Animation/CompoundSplineTrack.h
-    Source/Animation/EventNode.cpp
-    Source/Animation/EventNode.h
-    Source/Animation/TrackEventTrack.cpp
-    Source/Animation/TrackEventTrack.h
-    Source/Animation/UiAnimationSystem.cpp
-    Source/Animation/UiAnimationSystem.h
-    Source/Animation/UiAnimSerialize.cpp
-    Source/Animation/UiAnimSerialize.h
-    Source/Particle/UiParticle.cpp
-    Source/Particle/UiParticle.h
-    Source/Script/UiCanvasNotificationLuaBus.h
-    Source/Script/UiCanvasNotificationLuaBus.cpp
-    Source/Script/UiCanvasLuaBus.h
-    Source/Script/UiCanvasLuaBus.cpp
-    Source/Script/UiElementLuaBus.h
-    Source/Script/UiElementLuaBus.cpp
-    Source/World/UiCanvasOnMeshComponent.cpp
-    Source/World/UiCanvasOnMeshComponent.h
-    Source/World/UiCanvasAssetRefComponent.cpp
-    Source/World/UiCanvasAssetRefComponent.h
-    Source/World/UiCanvasProxyRefComponent.cpp
-    Source/World/UiCanvasProxyRefComponent.h
-)
-
-set(SKIP_UNITY_BUILD_INCLUSION_FILES
-    Source/UiImageSequenceComponent.h
-    Source/UiImageSequenceComponent.cpp
-    Source/UiTextComponent.cpp
-    Source/UiTextComponent.h
-)
-
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+set(FILES
+    Include/LyShine/IDraw2d.h
+    Include/LyShine/IRenderGraph.h
+    Include/LyShine/ISprite.h
+    Include/LyShine/ILyShine.h
+    Include/LyShine/UiAssetTypes.h
+    Include/LyShine/UiBase.h
+    Include/LyShine/UiLayoutCellBase.h
+    Include/LyShine/UiSerializeHelpers.h
+    Include/LyShine/UiComponentTypes.h
+    Include/LyShine/UiEntityContext.h
+    Include/LyShine/UiEditorDLLBus.h
+    Include/LyShine/UiRenderFormats.h
+    Include/LyShine/Animation/IUiAnimation.h
+    Include/LyShine/Bus/UiAnimationBus.h
+    Include/LyShine/Bus/UiAnimateEntityBus.h
+    Include/LyShine/Bus/UiButtonBus.h
+    Include/LyShine/Bus/UiCanvasBus.h
+    Include/LyShine/Bus/UiCanvasManagerBus.h
+    Include/LyShine/Bus/UiCanvasUpdateNotificationBus.h
+    Include/LyShine/Bus/UiCheckboxBus.h
+    Include/LyShine/Bus/UiCursorBus.h
+    Include/LyShine/Bus/UiDraggableBus.h
+    Include/LyShine/Bus/UiDropdownBus.h
+    Include/LyShine/Bus/UiDropdownOptionBus.h
+    Include/LyShine/Bus/UiDropTargetBus.h
+    Include/LyShine/Bus/UiDynamicLayoutBus.h
+    Include/LyShine/Bus/UiDynamicScrollBoxBus.h
+    Include/LyShine/Bus/UiEditorBus.h
+    Include/LyShine/Bus/UiEditorCanvasBus.h
+    Include/LyShine/Bus/UiEditorChangeNotificationBus.h
+    Include/LyShine/Bus/UiElementBus.h
+    Include/LyShine/Bus/UiEntityContextBus.h
+    Include/LyShine/Bus/UiFaderBus.h
+    Include/LyShine/Bus/UiFlipbookAnimationBus.h
+    Include/LyShine/Bus/UiGameEntityContextBus.h
+    Include/LyShine/Bus/UiHierarchyInteractivityToggleBus.h
+    Include/LyShine/Bus/UiImageBus.h
+    Include/LyShine/Bus/UiImageSequenceBus.h
+    Include/LyShine/Bus/UiIndexableImageBus.h
+    Include/LyShine/Bus/UiInitializationBus.h
+    Include/LyShine/Bus/UiInteractableActionsBus.h
+    Include/LyShine/Bus/UiInteractableBus.h
+    Include/LyShine/Bus/UiInteractableStatesBus.h
+    Include/LyShine/Bus/UiInteractionMaskBus.h
+    Include/LyShine/Bus/UiLayoutBus.h
+    Include/LyShine/Bus/UiLayoutCellBus.h
+    Include/LyShine/Bus/UiLayoutCellDefaultBus.h
+    Include/LyShine/Bus/UiLayoutColumnBus.h
+    Include/LyShine/Bus/UiLayoutControllerBus.h
+    Include/LyShine/Bus/UiLayoutFitterBus.h
+    Include/LyShine/Bus/UiLayoutGridBus.h
+    Include/LyShine/Bus/UiLayoutManagerBus.h
+    Include/LyShine/Bus/UiLayoutRowBus.h
+    Include/LyShine/Bus/UiMarkupButtonBus.h
+    Include/LyShine/Bus/UiMaskBus.h
+    Include/LyShine/Bus/UiNavigationBus.h
+    Include/LyShine/Bus/UiParticleEmitterBus.h
+    Include/LyShine/Bus/UiRadioButtonBus.h
+    Include/LyShine/Bus/UiRadioButtonCommunicationBus.h
+    Include/LyShine/Bus/UiRadioButtonGroupBus.h
+    Include/LyShine/Bus/UiRadioButtonGroupCommunicationBus.h
+    Include/LyShine/Bus/UiRenderBus.h
+    Include/LyShine/Bus/UiRenderControlBus.h
+    Include/LyShine/Bus/UiScrollableBus.h
+    Include/LyShine/Bus/UiScrollBarBus.h
+    Include/LyShine/Bus/UiScrollBoxBus.h
+    Include/LyShine/Bus/UiScrollerBus.h
+    Include/LyShine/Bus/UiSliderBus.h
+    Include/LyShine/Bus/UiSpawnerBus.h
+    Include/LyShine/Bus/UiSystemBus.h
+    Include/LyShine/Bus/UiTextBus.h
+    Include/LyShine/Bus/UiTextInputBus.h
+    Include/LyShine/Bus/UiTooltipBus.h
+    Include/LyShine/Bus/UiTooltipDataPopulatorBus.h
+    Include/LyShine/Bus/UiTooltipDisplayBus.h
+    Include/LyShine/Bus/UiTransform2dBus.h
+    Include/LyShine/Bus/UiTransformBus.h
+    Include/LyShine/Bus/UiVisualBus.h
+    Include/LyShine/Bus/Sprite/UiSpriteBus.h
+    Include/LyShine/Bus/World/UiCanvasOnMeshBus.h
+    Include/LyShine/Bus/World/UiCanvasRefBus.h
+    Include/LyShine/Bus/Tools/UiSystemToolsBus.h
+    Source/Draw2d.cpp
+    Source/Draw2d.h
+    Source/LyShine.cpp
+    Source/LyShine.h
+    Source/LyShinePassDataBus.h
+    Source/LyShineDebug.cpp
+    Source/LyShineDebug.h
+    Source/LyShineFeatureProcessor.cpp
+    Source/LyShineFeatureProcessor.h
+    Source/LyShinePass.cpp
+    Source/LyShinePass.h
+    Source/StringUtfUtils.h
+    Source/UiImageComponent.cpp
+    Source/UiImageComponent.h
+    Source/UiImageSequenceComponent.cpp
+    Source/UiImageSequenceComponent.h
+    Source/UiRenderer.cpp
+    Source/UiRenderer.h
+    Include/LyShine/LyShineBus.h
+    Source/EditorPropertyTypes.cpp
+    Source/EditorPropertyTypes.h
+    Source/LyShineLoadScreen.cpp
+    Source/LyShineLoadScreen.h
+    Source/RenderGraph.cpp
+    Source/RenderGraph.h
+    Source/RenderToTextureBus.h
+    Source/TextMarkup.cpp
+    Source/TextMarkup.h
+    Source/UiButtonComponent.cpp
+    Source/UiButtonComponent.h
+    Source/UiCanvasComponent.cpp
+    Source/UiCanvasComponent.h
+    Source/UiCanvasFileObject.cpp
+    Source/UiCanvasFileObject.h
+    Source/UiCanvasManager.cpp
+    Source/UiCanvasManager.h
+    Source/UiCheckboxComponent.cpp
+    Source/UiCheckboxComponent.h
+    Source/UiDraggableComponent.cpp
+    Source/UiDraggableComponent.h
+    Source/UiDropTargetComponent.cpp
+    Source/UiDropTargetComponent.h
+    Source/UiDropdownComponent.cpp
+    Source/UiDropdownComponent.h
+    Source/UiDropdownOptionComponent.cpp
+    Source/UiDropdownOptionComponent.h
+    Source/UiDynamicLayoutComponent.cpp
+    Source/UiDynamicLayoutComponent.h
+    Source/UiDynamicScrollBoxComponent.cpp
+    Source/UiDynamicScrollBoxComponent.h
+    Source/UiElementComponent.cpp
+    Source/UiElementComponent.h
+    Source/UiFaderComponent.cpp
+    Source/UiFaderComponent.h
+    Source/UiFlipbookAnimationComponent.cpp
+    Source/UiFlipbookAnimationComponent.h
+    Source/UiGameEntityContext.cpp
+    Source/UiGameEntityContext.h
+    Source/UiInteractableComponent.cpp
+    Source/UiInteractableComponent.h
+    Source/UiInteractableState.cpp
+    Source/UiInteractableState.h
+    Source/UiHierarchyInteractivityToggleComponent.cpp
+    Source/UiHierarchyInteractivityToggleComponent.h
+    Source/UiLayoutCellComponent.cpp
+    Source/UiLayoutCellComponent.h
+    Source/UiLayoutColumnComponent.cpp
+    Source/UiLayoutColumnComponent.h
+    Source/UiLayoutFitterComponent.cpp
+    Source/UiLayoutFitterComponent.h
+    Source/UiLayoutGridComponent.cpp
+    Source/UiLayoutGridComponent.h
+    Source/UiLayoutHelpers.cpp
+    Source/UiLayoutHelpers.h
+    Source/UiLayoutManager.cpp
+    Source/UiLayoutManager.h
+    Source/UiLayoutRowComponent.cpp
+    Source/UiLayoutRowComponent.h
+    Source/UiMarkupButtonComponent.cpp
+    Source/UiMarkupButtonComponent.h
+    Source/UiMaskComponent.cpp
+    Source/UiMaskComponent.h
+    Source/UiNavigationHelpers.cpp
+    Source/UiNavigationHelpers.h
+    Source/UiNavigationSettings.cpp
+    Source/UiNavigationSettings.h
+    Source/UiParticleEmitterComponent.cpp
+    Source/UiParticleEmitterComponent.h
+    Source/UiRadioButtonComponent.cpp
+    Source/UiRadioButtonComponent.h
+    Source/UiRadioButtonGroupComponent.cpp
+    Source/UiRadioButtonGroupComponent.h
+    Source/UiScrollBarComponent.cpp
+    Source/UiScrollBarComponent.h
+    Source/UiScrollBoxComponent.cpp
+    Source/UiScrollBoxComponent.h
+    Source/UiSerialize.cpp
+    Source/UiSerialize.h
+    Source/UiSliderComponent.cpp
+    Source/UiSliderComponent.h
+    Source/UiStateActionManager.cpp
+    Source/UiStateActionManager.h
+    Source/UiSpawnerComponent.cpp
+    Source/UiSpawnerComponent.h
+    Source/UiTextComponent.cpp
+    Source/UiTextComponent.h
+    Source/UiTextComponentOffsetsSelector.cpp
+    Source/UiTextComponentOffsetsSelector.h
+    Source/UiTextInputComponent.cpp
+    Source/UiTextInputComponent.h
+    Source/UiTooltipComponent.cpp
+    Source/UiTooltipComponent.h
+    Source/UiTooltipDisplayComponent.cpp
+    Source/UiTooltipDisplayComponent.h
+    Source/UiTransform2dComponent.cpp
+    Source/UiTransform2dComponent.h
+    Source/UiClipboard.h
+    Source/Sprite.cpp
+    Source/Sprite.h
+    Source/Animation/2DSpline.h
+    Source/Animation/AnimNode.cpp
+    Source/Animation/AnimNode.h
+    Source/Animation/AnimSequence.cpp
+    Source/Animation/AnimSequence.h
+    Source/Animation/AnimSplineTrack.h
+    Source/Animation/AnimSplineTrack_Vec2Specialization.cpp
+    Source/Animation/AnimTrack.h
+    Source/Animation/AzEntityNode.cpp
+    Source/Animation/AzEntityNode.h
+    Source/Animation/BoolTrack.cpp
+    Source/Animation/BoolTrack.h
+    Source/Animation/CompoundSplineTrack.cpp
+    Source/Animation/CompoundSplineTrack.h
+    Source/Animation/EventNode.cpp
+    Source/Animation/EventNode.h
+    Source/Animation/TrackEventTrack.cpp
+    Source/Animation/TrackEventTrack.h
+    Source/Animation/UiAnimationSystem.cpp
+    Source/Animation/UiAnimationSystem.h
+    Source/Animation/UiAnimSerialize.cpp
+    Source/Animation/UiAnimSerialize.h
+    Source/Particle/UiParticle.cpp
+    Source/Particle/UiParticle.h
+    Source/Script/UiCanvasNotificationLuaBus.h
+    Source/Script/UiCanvasNotificationLuaBus.cpp
+    Source/Script/UiCanvasLuaBus.h
+    Source/Script/UiCanvasLuaBus.cpp
+    Source/Script/UiElementLuaBus.h
+    Source/Script/UiElementLuaBus.cpp
+    Source/World/UiCanvasOnMeshComponent.cpp
+    Source/World/UiCanvasOnMeshComponent.h
+    Source/World/UiCanvasAssetRefComponent.cpp
+    Source/World/UiCanvasAssetRefComponent.h
+    Source/World/UiCanvasProxyRefComponent.cpp
+    Source/World/UiCanvasProxyRefComponent.h
+)
+
+set(SKIP_UNITY_BUILD_INCLUSION_FILES
+    Source/UiImageSequenceComponent.h
+    Source/UiImageSequenceComponent.cpp
+    Source/UiTextComponent.cpp
+    Source/UiTextComponent.h
+)
+