UMassActorSpawnerSubsystem

A subsystem managing spawning of actors for all mass subsystems

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

MassActors

Header

/Engine/Plugins/Runtime/MassGameplay/Source/MassActors/Public/MassActorSpawnerSubsystem.h

Include

#include "MassActorSpawnerSubsystem.h"

Syntax

UCLASS()
class UMassActorSpawnerSubsystem : public UWorldSubsystem

Remarks

A subsystem managing spawning of actors for all mass subsystems

Variables

Functions

Name Description

Public function Static

void

 

AddReferencedObjects

(
    UObject* InThis,
    FReferenceCollector& Collector
)

Public function

void

 

DestroyActor

(
    AActor* Actor,
    bool bImmediate
)

Destroy an actor

Public function

void

 

DisableActorPooling()

Public function

void

 

EnableActorPooling()

Public function

T &

 

GetMutableSpawnRequest

(
    const FMassActorSpawnRequestHandle ...
)

Returns the stored spawn request from the handle, useful to update the transform

Protected function Virtual Const

FMassActorSp...

 

GetNextRequestToSpawn()

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

Public function Const

const T &

 

GetSpawnRequest

(
    const FMassActorSpawnRequestHandle ...
)

Returns the stored spawn request from the handle, useful to update the transform

Protected function

void

 

OnPrePhysicsPhaseFinished

(
    const float DeltaSeconds
)

Called at the end of the PrePhysics mass processing phase and calls ProcessPendingDestruction

Protected function

void

 

OnPrePhysicsPhaseStarted

(
    const float DeltaSeconds
)

Called at the start of the PrePhysics mass processing phase and calls ProcessPendingSpawningRequest

Protected function

void

 

ProcessPendingDestruction

(
    const double MaxTimeSlicePerTick
)

Go through the queued actors to destroy and destroy them until we reach the budget

Protected function

void

 

ProcessPendingSpawningRequest

(
    const double MaxTimeSlicePerTick
)

Go through the spawning request and spawn them until we reach the budget

Protected function

bool

 

ReleaseActorToPool

(
    AActor* Actor
)

Try releasing this actor to pool if possible

Public function

void

 

ReleaseAllResources()

Public function

bool

 

RemoveActorSpawnRequest

(
    FMassActorSpawnRequestHandle& Spaw...
)

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.

Public function

FMassActorSp...

 

RequestActorSpawn

(
    const T& InSpawnRequest
)

Request an actor to spawn

Protected function

FMassActorSp...

 

RequestActorSpawnInternal

(
    const FConstStructView SpawnRequest
)

Internal generic request actor spawn to make sure the request derives from FMassActorSpawnRequest

Public function

void

 

RetryActorSpawnRequest

(
    const FMassActorSpawnRequestHandle ...
)

Retries a failed spawn request

Protected function Virtual Const

AActor *

 

SpawnActor

(
    const FStructView& SpawnRequest
)

Actual code that will spawn the actor, overridable by subclass if need to be.

Protected function Virtual

AActor *

 

SpawnOrRetrieveFromPool

(
    const FStructView& SpawnRequest
)

Overridden from USubsystem

Name Description

Public function Virtual

void

 

Deinitialize()

Implement this for deinitialization of instances of the system

Public function Virtual

void

 

Initialize

(
    FSubsystemCollectionBase& Collecti...
)

USubsystem BEGIN.