|
| enum class | InstantiateResult { Success
, MissingDependency
, CyclicalDependency
} |
| |
|
using | SliceInstancePtrSet = AZStd::unordered_set< SliceInstance * > |
| |
|
using | SliceReferenceToInstancePtrs = AZStd::unordered_map< SliceReference *, SliceInstancePtrSet > |
| |
|
using | SliceAssetToSliceInstancePtrs = AZStd::unordered_map< Data::Asset< SliceAsset >, SliceInstancePtrSet > |
| |
|
using | SliceInstanceAddressSet = AZStd::unordered_set< SliceInstanceAddress > |
| |
|
using | EntityList = AZStd::vector< Entity * > |
| |
|
using | EntityIdToEntityIdMap = AZStd::unordered_map< EntityId, EntityId > |
| |
|
using | SliceInstanceEntityIdRemapList = AZStd::vector< AZStd::pair< SliceInstanceAddress, EntityIdToEntityIdMap > > |
| |
|
using | SliceInstanceToSliceInstanceMap = AZStd::unordered_map< SliceInstanceAddress, SliceInstanceAddress > |
| |
|
using | EntityIdSet = AZStd::unordered_set< AZ::EntityId > |
| |
|
using | SliceInstanceId = AZ::Uuid |
| |
| using | PrefabReference = SliceReference |
| |
| using | PrefabInstance = SliceInstance |
| |
| using | PrefabInstanceAddress = SliceInstanceAddress |
| |
| using | PrefabInstanceId = SliceInstanceId |
| |
|
using | EntityDataFlagsMap = AZStd::unordered_map< EntityId, DataPatch::FlagsMap > |
| |
|
using | EntityAncestorList = AZStd::vector< Ancestor > |
| |
|
using | EntityRestoreInfoList = AZStd::vector< AZStd::pair< AZ::EntityId, AZ::SliceComponent::EntityRestoreInfo > > |
| |
|
using | SliceAssetToSliceInstances = AZStd::unordered_map< Data::Asset< SliceAsset >, SliceReference::SliceInstances > |
| |
|
using | SliceList = AZStd::list< SliceReference > |
| |
|
using | EntityInfoMap = AZStd::unordered_map< EntityId, EntityInfo > |
| |
|
typedef AZStd::unordered_set< Data::AssetId > | AssetIdSet |
| |
|
|
| AZ_COMPONENT (SliceComponent, "{AFD304E4-1773-47C8-855A-8B622398934F}", Data::AssetEvents) |
| |
|
SerializeContext * | GetSerializeContext () const |
| |
|
void | SetSerializeContext (SerializeContext *context) |
| |
|
void | ListenForAssetChanges () |
| | Connect to asset bus for dependencies.
|
| |
| void | ListenForDependentAssetChanges () |
| |
|
const EntityList & | GetNewEntities () const |
| | Returns list of the entities that are "new" for the current slice (not based on an existing slice)
|
| |
|
bool | IsNewEntity (EntityId entityId) const |
| | Returns true for entities that are "new" entities in this slice (entities not based on another slice)
|
| |
| bool | GetEntities (EntityList &entities) |
| |
| void | EraseEntities (const EntityList &entities) |
| |
| void | AddEntities (const EntityList &entities) |
| |
| void | ReplaceEntities (const EntityList &entities) |
| |
| void | AddSliceInstances (SliceAssetToSliceInstancePtrs &sliceInstances, AZStd::unordered_set< const SliceInstance * > &instancesOut) |
| |
| bool | GetEntityIds (EntityIdSet &entities) |
| |
| size_t | GetInstantiatedEntityCount () const |
| |
| bool | GetMetadataEntityIds (EntityIdSet &entities) |
| |
|
const SliceList & | GetSlices () const |
| | Returns list of all slices and their instantiated entities (for this slice component)
|
| |
|
SliceList & | GetSlices () |
| | Returns list of all slices and their instantiated entities (for this slice component)
|
| |
| const SliceList & | GetInvalidSlices () const |
| |
|
SliceReference * | GetSlice (const Data::Asset< SliceAsset > &sliceAsset) |
| |
|
SliceReference * | GetSlice (const Data::AssetId &sliceAssetId) |
| |
| SliceInstanceAddress | AddSlice (const Data::Asset< SliceAsset > &sliceAsset, const AZ::IdUtils::Remapper< AZ::EntityId >::IdMapper &customMapper=nullptr, SliceInstanceId sliceInstanceId=SliceInstanceId::CreateRandom()) |
| |
| SliceInstanceAddress | AddSliceUsingExistingEntities (const Data::Asset< SliceAsset > &sliceAsset, const AZ::SliceComponent::EntityIdToEntityIdMap &assetToLiveMap, SliceInstanceId sliceInstanceId=SliceInstanceId::CreateRandom()) |
| |
|
SliceReference * | AddSlice (SliceReference &sliceReference) |
| | Adds a slice reference (moves it) along with its instance information.
|
| |
|
SliceInstanceAddress | AddSliceInstance (SliceReference *sliceReference, SliceInstance *sliceInstance) |
| | Adds a slice (moves it) from another already generated reference/instance pair.
|
| |
| SliceInstanceAddress | CloneAndAddSubSliceInstance (const SliceInstance *sourceSliceInstance, const AZStd::vector< AZ::SliceComponent::SliceInstanceAddress > &sourceSubSliceInstanceAncestry, const AZ::SliceComponent::SliceInstanceAddress &sourceSubSliceInstanceAddress, AZ::SliceComponent::EntityIdToEntityIdMap *out_sourceToCloneEntityIdMap=nullptr, bool preserveIds=false) |
| |
|
bool | RemoveSlice (const Data::Asset< SliceAsset > &sliceAsset) |
| | Remove an entire slice asset reference and all its instances.
|
| |
|
bool | RemoveSlice (const SliceReference *slice) |
| |
|
bool | RemoveSliceInstance (SliceInstance *instance) |
| | Removes the slice instance, if this is last instance the SliceReference will be removed too.
|
| |
|
bool | RemoveSliceInstance (SliceInstanceAddress sliceAddress) |
| |
|
void | AddEntity (Entity *entity) |
| | Adds entity to the current slice and takes ownership over it (you should not manage/delete it)
|
| |
| AZ::Entity * | FindEntity (EntityId entityId) |
| |
|
bool | RemoveEntity (Entity *entity, bool isDeleteEntity=true, bool isRemoveEmptyInstance=true) |
| |
|
bool | RemoveEntity (EntityId entityId, bool isDeleteEntity=true, bool isRemoveEmptyInstance=true) |
| | Same as RemoveEntity but by using entityId.
|
| |
| bool | RemoveMetaDataEntity (EntityId metaDataEntityId) |
| |
| void | RemoveAllEntities (bool deleteEntities=true, bool removeEmptyInstances=true) |
| |
|
void | RemoveLooseEntity (EntityId entityId) |
| |
| SliceInstanceAddress | FindSlice (Entity *entity) |
| |
|
SliceInstanceAddress | FindSlice (EntityId entityId) |
| |
| bool | FlattenSlice (SliceReference *toFlatten, const EntityId &toFlattenRoot) |
| |
| bool | GetEntityRestoreInfo (const AZ::EntityId entityId, EntityRestoreInfo &info) |
| |
| SliceInstanceAddress | RestoreEntity (AZ::Entity *entity, const EntityRestoreInfo &restoreInfo, bool isEntityAdd=false) |
| |
| void | SetMyAsset (SliceAsset *asset) |
| |
| const SliceAsset * | GetMyAsset () const |
| |
| const DataPatch::FlagsMap & | GetEntityDataFlags (EntityId entityId) const |
| |
| bool | SetEntityDataFlags (EntityId entityId, const DataPatch::FlagsMap &dataFlags) |
| |
| DataPatch::Flags | GetEffectOfEntityDataFlagsAtAddress (EntityId, const DataPatch::AddressType &dataAddress) const |
| |
| DataPatch::Flags | GetEntityDataFlagsAtAddress (EntityId entityId, const DataPatch::AddressType &dataAddress) const |
| |
| bool | SetEntityDataFlagsAtAddress (EntityId entityId, const DataPatch::AddressType &dataAddress, DataPatch::Flags flags) |
| |
| bool | GetInstanceMetadataEntities (EntityList &outMetadataEntities) |
| |
| bool | GetAllInstanceMetadataEntities (EntityList &outMetadataEntities) |
| |
| bool | GetAllMetadataEntities (EntityList &outMetadataEntities) |
| |
| AZ::Entity * | GetMetadataEntity () |
| |
| void | GetReferencedSliceAssets (AssetIdSet &idSet, bool recurse=true) |
| |
| SliceComponent * | Clone (AZ::SerializeContext &serializeContext, SliceInstanceToSliceInstanceMap *sourceToCloneSliceInstanceMap=nullptr) const |
| |
| void | AllowPartialInstantiation (bool allow) |
| |
| bool | IsAllowPartialInstantiation () const |
| |
| bool | IsDynamic () const |
| |
| void | SetIsDynamic (bool isDynamic) |
| |
| InstantiateResult | Instantiate (AZ::SerializeContext *serializeContext=nullptr, AZStd::unordered_map< AZStd::string, AZStd::string > *relativeToAbsoluteSlicePaths=nullptr) |
| |
|
bool | IsInstantiated () const |
| |
| void | GenerateNewEntityIds (EntityIdToEntityIdMap *previousToNewIdMap=nullptr) |
| |
| void | InitMetadata () |
| |
| void | RemoveAndCacheInstances (const SliceReferenceToInstancePtrs &instancesToRemove) |
| |
| void | RestoreCachedInstances () |
| |
| const DataFlagsPerEntity & | GetDataFlagsForInstances () const |
| |
| | AZ_TYPE_INFO_WITH_NAME_DECL_API (AZCORE_API, Component) |
| |
|
| AZ_RTTI_NO_TYPE_INFO_DECL () |
| |
| AZ_CLASS_ALLOCATOR_DECL | Component () |
| |
| virtual | ~Component () |
| |
| Entity * | GetEntity () const |
| |
| EntityId | GetEntityId () const |
| |
| NamedEntityId | GetNamedEntityId () const |
| |
| ComponentId | GetId () const |
| |
| virtual TypeId | GetUnderlyingComponentType () const |
| |
| void | SetId (const ComponentId &id) |
| |
| virtual void | SetSerializedIdentifier (AZStd::string serializedIdentifer) |
| |
| virtual AZStd::string | GetSerializedIdentifier () const |
| |
| virtual ComponentValidationResult | ValidateComponentRequirements (const ImmutableEntityVector &, const AZStd::unordered_set< AZ::Crc32 > &) const |
| |
| bool | SetConfiguration (const AZ::ComponentConfig &config) |
| |
| bool | GetConfiguration (AZ::ComponentConfig &outConfig) const |
| |
|
|
SliceAsset * | m_myAsset |
| | Pointer to the asset we belong to, note this is just a reference stored by the handler, we don't need Asset<SliceAsset> as it's not a reference to another asset.
|
| |
|
SerializeContext * | m_serializeContext |
| |
|
EntityInfoMap | m_entityInfoMap |
| | A cached mapping built for quick lookups between an EntityId and its owning SliceInstance.
|
| |
|
EntityInfoMap | m_metaDataEntityInfoMap |
| | A cached mapping built for quick lookups between a MetaDataEntityId and its owning SliceInstance.
|
| |
|
EntityList | m_entities |
| | Entities that are new (not based on a slice).
|
| |
|
SliceList | m_slices |
| | List of base slices and their instances in the world.
|
| |
|
SliceAssetToSliceInstances | m_cachedSliceInstances |
| | Slice instances saved in layers on the root slice are cached here during the serialization process.
|
| |
|
SliceList | m_cachedSliceReferences |
| | Slice references saved in layers on the root slice are cached here during the serialization process.
|
| |
|
SliceList | m_invalidSlices |
| | List of slice references that did not load correctly.
|
| |
|
AZ::Entity | m_metadataEntity |
| | Entity for attaching slice metadata components.
|
| |
|
DataFlagsPerEntity | m_dataFlagsForNewEntities |
| | DataFlags for new entities (DataFlags for entities based on a slice are stored within the SliceInstance)
|
| |
|
DataFlagsPerEntity | m_cachedDataFlagsForInstances |
| | Cached DataFlags to be used when instantiating instances of this slice.
|
| |
|
bool | m_hasGeneratedCachedDataFlags |
| | Whether the cached DataFlags have been generated yet.
|
| |
|
AZStd::atomic< bool > | m_slicesAreInstantiated |
| | Instantiate state of the base slices (they should be instantiated or not)
|
| |
|
bool | m_allowPartialInstantiation |
| | Instantiation is still allowed even if dependencies are missing.
|
| |
|
bool | m_isDynamic |
| | Dynamic slices are available for instantiation at runtime.
|
| |
|
AZ::Data::AssetFilterCB | m_assetLoadFilterCB |
| | Asset load filter callback to apply for internal loads during data patching.
|
| |
|
AZ::u32 | m_filterFlags |
| | Asset load filter flags to apply for internal loads during data patching.
|
| |
|
AZStd::recursive_mutex | m_instantiateMutex |
| | Used to prevent multiple threads from trying to instantiate the slices at once.
|
| |
|
Entity * | m_entity |
| | Reference to the entity that owns the component. The value is null if the component is not attached to an entity.
|
| |
|
ComponentId | m_id |
| | A component ID that is unique for an entity. This component ID is not unique across all entities.
|
| |
Slice component manages entities on the project graph (Slice is a node). SliceComponent with nested dependencies is an edit only concept. We have a runtime version with dependencies so that we can accelerate production by live tweaking of game objects. Otherwise all slices should be exported as list of entities (flat structure). There is an exception with the "dynamic" slices, which should still be a flat list of entities that you "clone" for dynamic reuse.
| void AZ::SliceComponent::Deactivate |
( |
| ) |
|
|
overrideprotectedvirtual |
Deactivates the component. The system calls this function when the owning entity is being deactivated. You must override this function. As a best practice, ensure that this function returns the component to a minimal footprint. The order of deactivation is the reverse of activation, so your component is deactivated before the components it depends on.
The system always calls the component's Deactivate() function before destroying the component. However, deactivation is not always followed by the destruction of the component. An entity and its components can be deactivated and reactivated without being destroyed. Ensure that your Deactivate() implementation can handle this scenario.
Implements AZ::Component.