Navigation
API > API/Plugins > API/Plugins/MassActors
Inheritance Hierarchy
- UWorldSubsystem
- UMassSubsystemBase
- UMassActorSpawnerSubsystem
- UClientInstancedActorsSpawnerSubsystem
- UMassCrowdSpawnerSubsystem
- UServerInstancedActorsSpawnerSubsystem
References
| Module | MassActors |
| Header | /Engine/Plugins/Runtime/MassGameplay/Source/MassActors/Public/MassActorSpawnerSubsystem.h |
| Include | #include "MassActorSpawnerSubsystem.h" |
Syntax
UCLASS (Transient)
class UMassActorSpawnerSubsystem : public UMassSubsystemBase
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 | ||
| int32 | StartingHandleIndex |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddReferencedObjects
(
UObject* InThis, |
||
| void | ConditionalDestroyActor
(
UWorld& World, |
Provides consistent way of conditional destroying Actor within World. | |
| void | DestroyActor
(
AActor* Actor, |
Destroy an actor | |
| void | |||
| void | |||
| TObjectPtr< AActor > | FindActorByName
(
const FName ActorName, |
||
| T & | GetMutableSpawnRequest
(
const FMassActorSpawnRequestHandle SpawnRequestHandle |
Returns the stored spawn request from the handle, useful to update the transform | |
| FMassActorSpawnRequestHandle | GetNextRequestToSpawn
(
int32& InOutHandleIndex |
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 | |
| FMassActorSpawnRequestHandle | |||
| const T & | GetSpawnRequest
(
const FMassActorSpawnRequestHandle SpawnRequestHandle |
Returns the stored spawn request from the handle, useful to update the transform | |
| bool | |||
| bool | IsSpawnRequestHandleValid
(
const FMassActorSpawnRequestHandle SpawnRequestHandle |
||
| 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 | |
| ESpawnRequestStatus | ProcessSpawnRequest
(
const FMassActorSpawnRequestHandle SpawnRequestHandle |
Process a valid spawn request indicated by given handle. | |
| ESpawnRequestStatus | ProcessSpawnRequest
(
const FMassActorSpawnRequestHandle SpawnRequestHandle, |
Similar to the other ProcessSpawnRequest flavor, but with SpawnRequestView and SpawnRequest already provided. | |
| 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 UMassSubsystemBase
| Type | Name | Description | |
|---|---|---|---|
| void | Deinitialize () |
||
| void | Initialize
(
FSubsystemCollectionBase& Collection |
USubsystem BEGIN. |