#include <EntityContext.h>
Inherits EntityIdContextQueryBus::MultiHandler, AZ::EntityBus::MultiHandler, EntityContextRequestBus::Handler, and EntityOwnershipServiceNotificationBus::Handler.
Inherited by AzFramework::GameEntityContextComponent.
|
| 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 void | Reflect (AZ::ReflectContext *context) |
|
static AZStd::shared_ptr< Scene > | FindContainingScene (const EntityContextId &contextId) |
|
|
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) |
|
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).
◆ GetContextId()
- Returns
- the context's Id, which is used to listen on a given context's request or event bus.
◆ IsOwnedByThisContext()
bool AzFramework::EntityContext::IsOwnedByThisContext |
( |
const AZ::EntityId & |
entityId | ) |
|
|
protected |
Determine if the entity with the given ID is owned by this Entity Context
- Parameters
-
entityId | An entity ID to check |
- Returns
- true if this context owns the entity with the given id.
◆ ValidateEntitiesAreValidForContext()
virtual bool AzFramework::EntityContext::ValidateEntitiesAreValidForContext |
( |
const EntityList & |
entities | ) |
|
|
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.
The documentation for this class was generated from the following file:
- Code/Framework/AzFramework/AzFramework/Entity/EntityContext.h