#include <SliceMetadataInfoComponent.h>
Inherits AZ::Component, SliceMetadataInfoRequestBus::Handler, AZ::EntityBus::MultiHandler, and SliceMetadataInfoManipulationBus::Handler.
Public Types | |
using | EntityIdSet = AZStd::unordered_set< AZ::EntityId > |
Public Member Functions | |
AZ_COMPONENT (SliceMetadataInfoComponent, "{25EE4D75-8A17-4449-81F4-E561005BAABD}") | |
SliceMetadataInfoComponent (bool persistent=false) | |
~SliceMetadataInfoComponent () override | |
void | AddChildMetadataEntity (EntityId childEntityId) override |
void | RemoveChildMetadataEntity (EntityId childEntityId) override |
void | SetParentMetadataEntity (EntityId parentEntityId) override |
void | AddAssociatedEntity (EntityId associatedEntityId) override |
void | RemoveAssociatedEntity (EntityId associatedEntityId) override |
void | MarkAsPersistent (bool persistent) override |
void | Activate () override |
void | Deactivate () override |
Public Member Functions inherited from AZ::Component | |
AZ_TYPE_INFO_WITH_NAME_DECL (Component) | |
AZ_RTTI_NO_TYPE_INFO_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 |
Static Public Member Functions | |
static void | Reflect (AZ::ReflectContext *context) |
Protected Member Functions | |
void | OnEntityDestruction (const AZ::EntityId &entityId) override |
bool | IsAssociated (EntityId entityId) override |
void | GetAssociatedEntities (AZStd::set< EntityId > &associatedEntityIds) override |
AZ::EntityId | GetParentId () override |
void | GetChildIDs (AZStd::unordered_set< EntityId > &childEntityIds) override |
size_t | GetAssociationCount () override |
void | CheckDependencyCount () |
AZ::ExportedComponent | ExportComponent (AZ::Component *thisComponent, const AZ::PlatformTagSet &platformTags) |
Protected Member Functions inherited from AZ::Component | |
virtual void | Init () |
virtual void | Activate ()=0 |
virtual void | Deactivate ()=0 |
virtual bool | ReadInConfig (const ComponentConfig *baseConfig) |
virtual bool | WriteOutConfig (ComponentConfig *outBaseConfig) const |
virtual void | SetEntity (Entity *entity) |
virtual void | OnAfterEntitySet () |
Function to call after setting the entity in this component. | |
Static Protected Member Functions | |
static void | GetProvidedServices (AZ::ComponentDescriptor::DependencyArrayType &provided) |
static void | GetIncompatibleServices (AZ::ComponentDescriptor::DependencyArrayType &incompatible) |
Protected Attributes | |
friend | SliceComponent |
SliceMetadataInfoNotificationBus::BusPtr | m_notificationBus |
AZStd::set< AZ::EntityId > | m_associatedEntities |
Entity Association Data. | |
AZ::EntityId | m_parent |
EntityIdSet | m_children |
bool | m_persistent |
Protected Attributes inherited from AZ::Component | |
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 Metadata Entity Information Component This component maintains a list of all of the entities that are associated with a slice metadata entity. An associated entity is defined as one that is new to the slice at the nested level that the metadata entity is associated with, that is, it wasn't inherited from a base slice. All entities in every slice are associated with exactly one metadata entity. In addition to associated editor entities, this component also tracks any metadata entities belonging to any root slices referenced by the associated slice as well as, if applicable, the metadata entity belonging to the slice holding the reference to the associated slice.
AZ::SliceMetadataInfoComponent::SliceMetadataInfoComponent | ( | bool | persistent = false | ) |
Metadata Info Component Constructor
persistent | True if this info component should be persistent. A persistent component will not emit a notification when it has no dependencies. Only the actual destruction of the metadata entity will remove it from the context. |
|
override |
Destructor (Default)
|
overridevirtual |
Puts the component into an active state. The system calls this function once during activation of each entity that owns the component. You must override this function. The system calls a component's Activate() function only if all services and components that the component depends on are present and active. Use GetProvidedServices and GetDependentServices to specify these dependencies.
Implements AZ::Component.
|
protected |
Gets the number of objects that are attached to this metadata entity. This includes both associated editor entities and child metadata entities belonging to referenced slices. If the dependency count is zero, this will send an OnMetadataDependenciesRemoved notification. Because this could result in the destruction of the metadata entity, be careful when calling this. This function does nothing if the component is marked as persistent. Note: This function can trigger the removal of the owning entity from the metadata context but can not trigger the deletion of the entity itself.
|
overridevirtual |
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.
|
protected |
Handles the runtime export of the SliceMetadataInfoComponent.
The SliceMetadataInfo component shouldn't exist at runtime, so the export function returns a null component.
thisComponent | The source component that is being exported. |
platformTags | The set of platforms to export for. |
|
staticprotected |
Component Descriptor - Incompatible Services
incompatible | An array to fill out with all the services this component is incompatible with |
|
staticprotected |
Component Descriptor - Provided Services
provided | An array to fill out with all the services this component is dependent on |
|
static |
|
protected |
Entity Association Data.
A list of editor entities associated with this slice metadata An associated entity is one that is new to this slice as opposed to an entity cloned from a referenced slice. Every editor entity should always be associated with exactly one metadata entity. Entities that are not part of slices are associated with the metadata component belonging to the root slice.
|
protected |
The IDs of each metadata entity associated with an slice instance belonging to the associated slice.
|
protected |
A bus pointer for emitting addressed notifications
|
protected |
If the associated slice instance belongs to another slice, this is the ID of the metadata entity associated with that parent slice instance. Note: The root entity will never show up as a parent. Slices that are not instances belonging to a non-root slice have no parent.
|
protected |
The persistence flag indicates that the object is valid even without dependencies and will not emit the OnMetadataDependenciesRemoved notification when it's dependency count goes to 0. For example: The Root Slice.