Navigation
API > API/Plugins > API/Plugins/MassActors
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- USubsystem
- UWorldSubsystem
- UMassActorSpawnerSubsystem
- UMassCrowdSpawnerSubsystem
- UMassLWIClientActorSpawnerSubsystem
References
| Module | MassActors |
| Header | /Engine/Plugins/Runtime/MassGameplay/Source/MassActors/Public/MassActorSpawnerSubsystem.h |
| Include | #include "MassActorSpawnerSubsystem.h" |
Syntax
UCLASS&40;&41;
class UMassActorSpawnerSubsystem : public UWorldSubsystem
Remarks
A subsystem managing spawning of actors for all mass subsystems
Variables
| Type | Name | Description | |
|---|---|---|---|
| TArray< TObjectPtr< AActor > > | ActorsToDestroy | ||
| bool | bActorPoolingEnabled | ||
| TArray< TObjectPtr< AActor > > | DeactivatedActorsToDestroy | ||
| int32 | NumActorPooled | ||
| int32 | NumActorSpawned | ||
| TMap< TSubclassOf< AActor >, TArray< TObjectPtr< AActor > > > | PooledActors | ||
| std::atomic< uint32 > | RequestSerialNumberCounter | ||
| FMassEntityHandleManager_ActorSpawnRequest | SpawnRequestHandleManager | ||
| TArray< FInstancedStruct > | SpawnRequests |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddReferencedObjects
(
UObject* InThis, |
||
| void | DestroyActor
(
AActor* Actor, |
Destroy an actor | |
| void | |||
| void | |||
| T & | GetMutableSpawnRequest
(
const FMassActorSpawnRequestHandle SpawnRequestHandle |
Returns the stored spawn request from the handle, useful to update the transform | |
| FMassActorSpawnRequestHandle | Retrieve what would be the next best spawning request to spawn, can be overridden to have different logic Default implementation is the first valid request in the list, no interesting logic yet | ||
| const T & | GetSpawnRequest
(
const FMassActorSpawnRequestHandle SpawnRequestHandle |
Returns the stored spawn request from the handle, useful to update the transform | |
| void | OnPrePhysicsPhaseFinished
(
const float DeltaSeconds |
Called at the end of the PrePhysics mass processing phase and calls ProcessPendingDestruction | |
| void | OnPrePhysicsPhaseStarted
(
const float DeltaSeconds |
Called at the start of the PrePhysics mass processing phase and calls ProcessPendingSpawningRequest | |
| void | ProcessPendingDestruction
(
const double MaxTimeSlicePerTick |
Go through the queued actors to destroy and destroy them until we reach the budget | |
| void | ProcessPendingSpawningRequest
(
const double MaxTimeSlicePerTick |
Go through the spawning request and spawn them until we reach the budget | |
| bool | ReleaseActorToPool
(
AActor* Actor |
Try releasing this actor to pool if possible | |
| void | |||
| bool | RemoveActorSpawnRequest
(
FMassActorSpawnRequestHandle& SpawnRequestHandle |
Removes a spawn request The only time a spawn request cannot be removed is when its state is processing Also spawn requests are auto removed if you provided a spawn delegate after it was being executed. | |
| FMassActorSpawnRequestHandle | RequestActorSpawn
(
const T& InSpawnRequest |
Request an actor to spawn Note: If you do not provide a spawn delegate, the requester is responsible to remove the request by hand. | |
| FMassActorSpawnRequestHandle | RequestActorSpawnInternal
(
const FConstStructView SpawnRequest |
Internal generic request actor spawn to make sure the request derives from FMassActorSpawnRequest | |
| void | RetryActorSpawnRequest
(
const FMassActorSpawnRequestHandle SpawnRequestHandle |
Retries a failed spawn request | |
| ESpawnRequestStatus | SpawnActor
(
FConstStructView SpawnRequestView, |
Actual code that will spawn the actor, overridable by subclass if need to be. | |
| ESpawnRequestStatus | SpawnOrRetrieveFromPool
(
FConstStructView SpawnRequestView, |
Overridden from USubsystem
| Type | Name | Description | |
|---|---|---|---|
| void | Deinitialize () |
Implement this for deinitialization of instances of the system | |
| void | Initialize
(
FSubsystemCollectionBase& Collection |
USubsystem BEGIN. |