Open 3D Engine AzFramework API Reference
2305.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
#include <EntityContext.h>
Inherits MultiHandler, MultiHandler, Handler, and Handler.
Inherited by AzFramework::GameEntityContextComponent.
Public Types | |
using | SceneStorageType = EntityContext * |
The type used to store entity in AzFramework::Scene. | |
Public Member Functions | |
AZ_TYPE_INFO (EntityContext,"{4F98A6B9-C7B5-450E-8A8A-30EEFC411EF5}") | |
EntityContext (AZ::SerializeContext *serializeContext=nullptr) | |
EntityContext (const EntityContextId &contextId, AZ::SerializeContext *serializeContext=nullptr) | |
EntityContext (const EntityContextId &contextId, AZStd::unique_ptr< EntityOwnershipService > entityOwnershipService, AZ::SerializeContext *serializeContext=nullptr) | |
void | InitContext () |
void | DestroyContext () |
const EntityContextId & | GetContextId () const |
AZ::Entity * | CreateEntity (const char *name) override |
void | AddEntity (AZ::Entity *entity) override |
void | ActivateEntity (AZ::EntityId entityId) override |
void | DeactivateEntity (AZ::EntityId entityId) override |
bool | DestroyEntity (AZ::Entity *entity) override |
bool | DestroyEntityById (AZ::EntityId entityId) override |
AZ::Entity * | CloneEntity (const AZ::Entity &sourceEntity) override |
void | ResetContext () override |
Static Public Member Functions | |
static void | Reflect (AZ::ReflectContext *context) |
static AZStd::shared_ptr< Scene > | FindContainingScene (const EntityContextId &contextId) |
Protected Member Functions | |
EntityContextId | GetOwningContextId () override |
void | PrepareForEntityOwnershipServiceReset () override |
void | OnEntityOwnershipServiceReset () override |
void | OnEntitiesReloadedFromStream (const EntityList &entities) override |
void | OnEntityDestruction (const AZ::EntityId &entityId) override |
void | HandleEntitiesAdded (const EntityList &entities) |
void | HandleEntitiesRemoved (const EntityIdList &entityIds) |
AZ::SerializeContext * | GetSerializeContext () const |
virtual void | OnContextEntitiesAdded (const EntityList &) |
Entity context derived implementations can conduct specialized actions when internal events occur, such as adds/removals/resets. | |
virtual void | OnContextEntityRemoved (const AZ::EntityId &) |
virtual void | OnRootEntityReloaded () |
virtual void | PrepareForContextReset () |
virtual void | OnContextReset () |
virtual bool | ValidateEntitiesAreValidForContext (const EntityList &entities) |
bool | IsOwnedByThisContext (const AZ::EntityId &entityId) |
Protected Attributes | |
AZ::SerializeContext * | m_serializeContext |
EntityContextId | m_contextId |
Id of the context, used to address bus messages. | |
EntityContextEventBus::BusPtr | m_eventBusPtr |
Pre-bound event bus for the context. | |
AZStd::unique_ptr < EntityOwnershipService > | m_entityOwnershipService |
EntityOwnershipService is responsible for the management of entities used by this context. Such as loading, creation, etc. | |
bool | m_contextIsResetting = false |
Provides services for a group of entities under the umbrella of a given context.
e.g. Edit-time entities and runtime entities would belong to separate contexts.
A context owns a root entity, which can be serialized in or out. Interfaces are provided for creating entities owned by the context.
Entity contexts are not required to use entities, but provide a package for managing independent prefab hierarchies (i.e. a level, a world, etc).
|
inline |
|
protected |
Determine if the entity with the given ID is owned by this Entity Context
entityId | An entity ID to check |
|
protectedvirtual |
Used to validate that the given list of entities are valid for this context For example they could be non-UI entities being instantiated in a UI context
Reimplemented in AzFramework::GameEntityContextComponent.