Navigation
API > API/Runtime > API/Runtime/MassEntity
Base class for Processors that are used as "observers" of entity operations. An observer declares the types of Mass elements it cares about (Fragments and Tags supported) - via the ObservedTypes array - and the types of operations it wants to be notified of - via ObservedOperations.
When an observed operation takes place the processor's regular execution will take place, with ExecutionContext's "auxiliary data" (obtained by calling GetAuxData) being filled with an instance of FMassObserverExecutionContext, that can be used to get information about the type being handled and the kind of operation.
To observe multiple types, populate the ObservedTypes array in the constructor: UMyObserver::UMyObserver(){ObservedTypes={FMyFragment::StaticStruct(),FOtherFragment::StaticStruct()};ObservedOperations=EMassObservedOperationFlags::Add;}
When multiple observed types are added simultaneously, Execute() fires exactly once per entity batch thanks to deduplication in FMassObserverManager::HandleElementsImpl.
| Name | UMassObserverProcessor |
| Type | class |
| Header File | /Engine/Source/Runtime/MassEntity/Public/MassObserverProcessor.h |
| Include Path | #include "MassObserverProcessor.h" |
Syntax
UCLASS (MinimalAPI, Abstract)
class UMassObserverProcessor : public UMassProcessor
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UMassProcessor → UMassObserverProcessor
Derived Classes
UMassObserverProcessor derived class hierarchy
- UAssignDebugVisProcessor
- UMassSmartObjectDeinitializerBase
- UMassSmartObjectInitializerBase
- UMassBaseStaticMeshDestroyRenderStateProcessor
- UMassRelationObserver
- UMassCrowdDynamicObstacleDeinitializer
- UMassCrowdDynamicObstacleInitializer
- UMassCrowdLaneTrackingDestructor
- UMassDestroyRenderStateProcessor
- UMassLookAtRequestDeinitializer
- UMassLookAtRequestInitializer
- UMassLookAtTargetRemoverProcessor
- UMassMoveTargetFragmentInitializer
- UMassNavigationObstacleRemoverProcessor
- UMassNavigationRelevantMassDeinitializer
- UMassNetworkIDFragmentInitializer
- UMassRandomVelocityInitializer
- UMassReplicationEntityDestructionObserver
- UMassReplicationGridRemoverProcessor
- UMassRepresentationFragmentDestructor
- UMassSmartObjectUserFragmentDeinitializer
- UMassStateTreeFragmentDestructor
- UMassStationaryISMRepresentationFragmentDestructor
- UMassTestCompositeObserverProcessor
- UMassZoneGraphAnnotationTagsInitializer
- UMassZoneGraphLocationInitializer
- USpringMovementLODResyncObserver
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| MassObserverProcessor.h | |||
UMassObserverProcessor
(
const FObjectInitializer& ObjectInitializer |
MassObserverProcessor.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
EMassObservedOperationFlags GetObservedOperations() |
Inlines | MassObserverProcessor.h | |
TNotNull< const UScriptStruct * > GetObservedTypeChecked() |
MassObserverProcessor.h | ||
TConstArrayView< const UScriptStruct * > GetObservedTypes() |
MassObserverProcessor.h | ||
const UScriptStruct * GetSingleObservedType() |
MassObserverProcessor.h | ||
TNotNull< const UScriptStruct * > GetSingleObservedTypeChecked () |
Observers support observing multiple fragments now, but if you know there's only one you can fetch it with this function. | MassObserverProcessor.h |
Protected Virtual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Register () |
Called from PostInitProperties on the CDO when ObservedOperations is set. | MassObserverProcessor.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostInitProperties() |
MassObserverProcessor.h |