Open 3D Engine LyShine Gem 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.
UiEditorEntityContextRequests Class Referenceabstract

#include <UiEditorEntityContextBus.h>

Inherits AZ::EBusTraits.

Public Types

typedef AzFramework::EntityContextId BusIdType
 

Public Member Functions

virtual AZ::SliceComponent * GetUiRootSlice ()=0
 Retrieves the root slice for the UI entity context.
 
virtual AZ::SliceComponent::SliceInstanceAddress CloneEditorSliceInstance (AZ::SliceComponent::SliceInstanceAddress sourceInstance)=0
 
virtual AzFramework::SliceInstantiationTicket InstantiateEditorSlice (const AZ::Data::Asset< AZ::Data::AssetData > &sliceAsset, AZ::Vector2 viewportPosition)=0
 Instantiates a UI slice.
 
virtual AzFramework::SliceInstantiationTicket InstantiateEditorSliceAtChildIndex (const AZ::Data::Asset< AZ::Data::AssetData > &sliceAsset, AZ::Vector2 viewportPosition, int childIndex)=0
 Instantiates a UI slice at the specified child index.
 
virtual void RestoreSliceEntity (AZ::Entity *entity, const AZ::SliceComponent::EntityRestoreInfo &info)=0
 
virtual void QueueSliceReplacement (const char *targetPath, const AZStd::unordered_map< AZ::EntityId, AZ::EntityId > &selectedToAssetMap, const AZStd::unordered_set< AZ::EntityId > &entitiesToReplace, AZ::Entity *commonParent, AZ::Entity *insertBefore)=0
 
virtual void DeleteElements (AzToolsFramework::EntityIdList elements)=0
 Use an undoable command to delete the given entities.
 
virtual bool HasPendingRequests ()=0
 Query whether there are pending asynchronous requests waiting on the asset system.
 
virtual bool IsInstantiatingSlices ()=0
 Query whether there are slices being instantiated asynchronously.
 
virtual void DetachSliceEntities (const AzToolsFramework::EntityIdList &entities)=0
 Detaches entities from their current slice instance and adds them to root slice as loose entities.
 

Static Public Attributes

static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById
 
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single
 

Detailed Description

Bus for making requests to the UI Editor entity context. There is one UiEntityContext per UI canvas, if it is loaded in the editor then its context will be a UiEditorEntityContext.

Member Function Documentation

◆ CloneEditorSliceInstance()

virtual AZ::SliceComponent::SliceInstanceAddress UiEditorEntityContextRequests::CloneEditorSliceInstance ( AZ::SliceComponent::SliceInstanceAddress  sourceInstance)
pure virtual

Clones an existing slice instance in this UI entity context. New instance is immediately returned.

Returns
address of new slice instance. A null address will be returned if the source instance address is invalid.

◆ QueueSliceReplacement()

virtual void UiEditorEntityContextRequests::QueueSliceReplacement ( const char *  targetPath,
const AZStd::unordered_map< AZ::EntityId, AZ::EntityId > &  selectedToAssetMap,
const AZStd::unordered_set< AZ::EntityId > &  entitiesToReplace,
AZ::Entity *  commonParent,
AZ::Entity *  insertBefore 
)
pure virtual

Editor functionality to replace a set of entities with a new instance of a new slice asset. This is a deferred operation since the asset may not yet have been processed (i.e. new asset). Once the asset has been created, it will be loaded and instantiated.

Parameters
targetPathpath to the slice asset to be instanced in-place over the specified entities.
selectedToAssetMaprelates selected (live) entity Ids to Ids in the slice asset for post-replace Id reference patching.
entitiesToReplacecontains entity Ids to be replaced.

◆ RestoreSliceEntity()

virtual void UiEditorEntityContextRequests::RestoreSliceEntity ( AZ::Entity *  entity,
const AZ::SliceComponent::EntityRestoreInfo &  info 
)
pure virtual

Restores an entity back to a slice instance for undo/redo only. A valid EntityRestoreInfo must be provided, and is only extracted directly via SliceReference::GetEntityRestoreInfo().


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