Open 3D Engine AzToolsFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzToolsFramework::Prefab::PrefabConversionUtils::UiEditorOnlyEntityHandler Class Reference

#include <UiEditorOnlyEntityHandler.h>

Inherits AzToolsFramework::Prefab::PrefabConversionUtils::EditorOnlyEntityHandler.

Public Member Functions

 AZ_CLASS_ALLOCATOR (UiEditorOnlyEntityHandler, AZ::SystemAllocator)
 
 AZ_RTTI (AzToolsFramework::Prefab::PrefabConversionUtils::UiEditorOnlyEntityHandler, "{949CF813-4A8E-4D55-B323-0ED2A967CDCC}", EditorOnlyEntityHandler)
 
bool IsEntityUniquelyForThisHandler (AZ::Entity *entity) const override
 
void AddEditorOnlyEntity (AZ::Entity *editorOnlyEntity, EntityIdSet &editorOnlyEntities) override
 
Result HandleEditorOnlyEntities (const AzToolsFramework::EntityList &entities, const AzToolsFramework::EntityIdSet &editorOnlyEntityIds, AZ::SerializeContext &serializeContext) override
 
- Public Member Functions inherited from AzToolsFramework::Prefab::PrefabConversionUtils::EditorOnlyEntityHandler
 AZ_CLASS_ALLOCATOR (EditorOnlyEntityHandler, AZ::SystemAllocator)
 
 AZ_RTTI (AzToolsFramework::Prefab::PrefabConversionUtils::EditorOnlyEntityHandler, "{C420F65D-18AE-4CAF-BB18-70FA4FE73243}")
 
virtual bool IsEntityUniquelyForThisHandler (AZ::Entity *entity) const =0
 
virtual void AddEditorOnlyEntity (AZ::Entity *editorOnlyEntity, AZStd::unordered_set< AZ::EntityId > &editorOnlyEntities)
 
virtual Result HandleEditorOnlyEntities (const EntityList &, const EntityIdSet &, AZ::SerializeContext &)
 

Additional Inherited Members

- Public Types inherited from AzToolsFramework::Prefab::PrefabConversionUtils::EditorOnlyEntityHandler
using Result = AZ::Outcome< void, AZStd::string >
 
- Static Public Member Functions inherited from AzToolsFramework::Prefab::PrefabConversionUtils::EditorOnlyEntityHandler
static Result ValidateReferences (const EntityList &entities, const EntityIdSet &editorOnlyEntityIds, AZ::SerializeContext &serializeContext)
 

Detailed Description

EditorOnlyEntity handler for UI entities.

  • Removes editor-only entities and their descedent hierarchy entirely. – This differs from the world-entity handler where editor-only entities are removed "in-place".
  • Validates that no editor entities are referenced by non-editor entities.

Member Function Documentation

◆ AddEditorOnlyEntity()

void AzToolsFramework::Prefab::PrefabConversionUtils::UiEditorOnlyEntityHandler::AddEditorOnlyEntity ( AZ::Entity *  editorOnlyEntity,
EntityIdSet &  editorOnlyEntities 
)
overridevirtual

Adds the given entity ID to the set of editor only entities.

Handlers can customize this behavior, such as additionally adding child entities when a parent is marked as editor-only.

Reimplemented from AzToolsFramework::Prefab::PrefabConversionUtils::EditorOnlyEntityHandler.

◆ HandleEditorOnlyEntities()

Result AzToolsFramework::Prefab::PrefabConversionUtils::UiEditorOnlyEntityHandler::HandleEditorOnlyEntities ( const AzToolsFramework::EntityList &  ,
const AzToolsFramework::EntityIdSet &  ,
AZ::SerializeContext &   
)
overridevirtual

This handler is responsible for making any necessary modifications to other entities in the Prefab prior to the removal of all editor-only entities. After this callback returns, editor-only entities will be removed from the Prefab. See WorldEditorOnlyEntityHandler below for an example of processing and validation that occurs for standard world entities.

Parameters
entitiesa list of all entities in the Prefab, including those marked as editor-only.
editorOnlyEntityIdsa precomputed set containing Ids for all entities within the 'entities' list that were marked as editor-only.
serializeContextuseful to inspect entity data for validation purposes.

Reimplemented from AzToolsFramework::Prefab::PrefabConversionUtils::EditorOnlyEntityHandler.

◆ IsEntityUniquelyForThisHandler()

bool AzToolsFramework::Prefab::PrefabConversionUtils::UiEditorOnlyEntityHandler::IsEntityUniquelyForThisHandler ( AZ::Entity *  entity) const
overridevirtual

The documentation for this class was generated from the following file: