Navigation
API > API/Plugins > API/Plugins/InstancedActors
Provides Mass Entity reference and interop functions for Actors spawned via Instanced Actors on both client & server.
| Name | UInstancedActorsComponent |
| Type | class |
| Header File | /Engine/Plugins/Runtime/InstancedActors/Source/InstancedActors/Public/InstancedActorsComponent.h |
| Include Path | #include "InstancedActorsComponent.h" |
Syntax
UCLASS (MinimalAPI, ClassGroup="Instanced Actors", Meta=(BlueprintSpawnableComponent))
class UInstancedActorsComponent : public UActorComponent
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → UInstancedActorsComponent
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UInstancedActorsComponent() |
InstancedActorsComponent.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddFragmentDeferred() |
If HasMassEntity(), adds a new default constructed FragmentType to this Instanced Actor's Mass entity, if not already present (no-op otherwise) Performed deferred using FMassCommandBuffer to safely add fragments, as Mass may currently be performing parallel processing. | InstancedActorsComponent.h | |
void AddOrUpdateFragmentsDeferred
(
FragmentTypes&&... NewFragments |
If HasMassEntity(), adds or updates existing FragmentTypes for this Instanced Actor's Mass entity. | InstancedActorsComponent.h | |
void AddOrUpdatePersistentFragmentsDeferred
(
FragmentTypes&&... NewFragments |
If HasMassEntity(), adds or updates existing FragmentTypes for this Instanced Actor's Mass entity, then requests a persistent data resave once the fragments are updated. | InstancedActorsComponent.h | |
virtual uint32 GetInstancePersistenceDataID() |
Subclasses implementing SerializeInstancePersistenceData must implement this method and return a non-zero unique uint32 used to match serialized persistence records with this UInstancedActorsComponent's SerializeInstancePersistenceData implementation. | InstancedActorsComponent.h | |
| Handle to this Instanced Actor's Mass Entity, if this components Actor owner was spawned by the Instanced Actor system, invalid handle otherwise. | InstancedActorsComponent.h | ||
TSharedPtr< FMassEntityManager > GetMassEntityManager() |
If HasMassEntity(), the Mass Entity Manager for MassEntityHandle | InstancedActorsComponent.h | |
FMassEntityManager & GetMassEntityManagerChecked() |
InstancedActorsComponent.h | ||
const FragmentType * GetVolatileFragment () |
If HasMassEntity(), returns existing FragmentType fragment for this Instanced Actor's Mass Entity, if any. | InstancedActorsComponent.h | |
bool HasMassEntity () |
Returns true if this Actor was spawned by the Instanced Actor system for a Mass Entity. | InstancedActorsComponent.h |
|
virtual void InitializeComponentForInstance
(
FInstancedActorsInstanceHandle InInstanceHandle |
Called on servers during InitializeComponent for Actors spawned by the Instanced Actor system. | InstancedActorsComponent.h | |
virtual void ModifyMassEntityConfig
(
FMassEntityManager& InMassEntityManager, |
Called on an 'exemplar' Actor's components for clients & servers during UInstancedActorsData::CreateEntityTemplate to provide UInstancedActorsComponent's an opportunity to extend Mass entity default traits. | InstancedActorsComponent.h | |
virtual void ModifyMassEntityTemplate
(
FMassEntityManager& InMassEntityManager, |
Called on ActorClass CDO components for clients & servers during UInstancedActorsData::CreateEntityTemplate to provide UInstancedActorsComponent's an opportunity to extend Mass entity default fragments. | InstancedActorsComponent.h | |
virtual void OnServerPreSpawnInitForInstance
(
FInstancedActorsInstanceHandle InInstanceHandle |
Called on servers before InitializeComponent & BeginPlay in UServerInstancedActorsSpawnerSubsystem::SpawnActor for Actors spawned by the Instanced Actor system. | InstancedActorsComponent.h | |
void RemoveFragmentDeferred() |
If HasMassEntity(), removes FragmentType from this Instanced Actor's Mass entity, if present (no-op otherwise) Performed deferred using FMassCommandBuffer to safely add fragments, as Mass may currently be performing parallel processing. | InstancedActorsComponent.h | |
virtual void SerializeInstancePersistenceData
(
FStructuredArchive::FRecord Record, |
Called by AInstancedActorsManager::SerializeInstancePersistenceData for IAD's with an ActorClass containing this UInstancedActorsComponent, to save / load extended persistence data. | InstancedActorsComponent.h | |
virtual bool ShouldSerializeInstancePersistenceData
(
const FArchive& Archive, |
Called prior to SerializeInstancePersistenceData for both saving & loading persistence data, to check if we indeed have persistence data to write / want to read. | InstancedActorsComponent.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void OnRep_InstanceHandle() |
InstancedActorsComponent.h |
Overridden from UActorComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void EndPlay
(
const EEndPlayReason::Type EndPlayReason |
InstancedActorsComponent.h | ||
virtual void InitializeComponent() |
InstancedActorsComponent.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void GetLifetimeReplicatedProps
(
TArray< FLifetimeProperty >& OutLifetimeProps |
InstancedActorsComponent.h |