UGameFrameworkComponentManager

GameFrameworkComponentManager

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

ModularGameplay

Header

/Engine/Plugins/Experimental/ModularGameplay/Source/ModularGameplay/Public/Components/GameFrameworkComponentManager.h

Include

#include "Components/GameFrameworkComponentManager.h"

Syntax

UCLASS(MinimalAPI)
class UGameFrameworkComponentManager : public UGameInstanceSubsystem

Remarks

GameFrameworkComponentManager

A manager to handle putting components on actors as they come and go. Put in a request to instantiate components of a given class on actors of a given class and they will automatically be made for them as the actors are spawned. Submit delegate handlers to listen for actors of a given class. Those handlers will automatically run when actors of a given class or registered as receivers or game events are sent. Actors must opt-in to this behavior by calling AddReceiver/RemoveReceiver for themselves when they are ready to receive the components and when they want to remove them. Any actors that are in memory when a request is made will automatically get the components, and any in memory when a request is removed will lose the components immediately. Requests are reference counted, so if multiple requests are made for the same actor class and component class, only one component will be added and that component wont be removed until all requests are removed.

Functions

Name Description

Public function

TSharedPtr< ...

 

AddComponentRequest

(
    const TSoftClassPtr< AActor >& Rec...,
    TSubclassOf< UActorComponent > Comp...
)

Adds a request to instantiate components on actors of the given classes.

Public function

TSharedPtr< ...

 

AddExtensionHandler

(
    const TSoftClassPtr< AActor >& Rec...,
    FExtensionHandlerDelegate Extension...
)

Adds an extension handler to run on actors of the given class.

Public function Static

void

 

AddGameFrameworkComponentReceiver

(
    AActor* Receiver,
    bool bAddOnlyInGameWorlds
)

Adds an actor as a receiver for components (automatically finding the manager for the actor's game instance).

Public function UFunction BlueprintCallable, Category, Meta

void

 

AddReceiver

(
    AActor* Receiver,
    bool bAddOnlyInGameWorlds
)

Adds an actor as a receiver for components.

Public function Static

void

 

AddReferencedObjects

(
    UObject* InThis,
    FReferenceCollector& Collector
)

Public function Static

void

 

DumpGameFrameworkComponentManagers()

Public function

void

 

InitGameFrameworkComponentManager()

Public function Static

void

 

RemoveGameFrameworkComponentReceiver

(
    AActor* Receiver
)

Removes an actor as a receiver for components (automatically finding the manager for the actor's game instance).

Public function UFunction BlueprintCallable, Category, Meta

void

 

RemoveReceiver

(
    AActor* Receiver
)

Removes an actor as a receiver for components.

Public function UFunction BlueprintCallable, Category, Meta

void

 

SendExtensionEvent

(
    AActor* Receiver,
    FName EventName,
    bool bOnlyInGameWorlds
)

Sends an arbitrary extension event that can be listened for by other systems

Public function Static

void

 

SendGameFrameworkComponentExtensionEvent

(
    AActor* Receiver,
    const FName& EventName,
    bool bOnlyInGameWorlds
)

Sends an arbitrary extension event that can be listened for by other systems

Typedefs

Name

Description

FExtensionHandlerDelegate

Delegate types for extension handlers

FExtensionHandlerDelegateInternal

Using a fake multicast delegate so order can be kept consistent

FExtensionHandlerEvent

Constants

Name

Description

NAME_ExtensionAdded

A new extension handler was added

NAME_ExtensionRemoved

An extension handler was removed by a freed request handle

NAME_GameActorReady

Game-specific event indicating an actor is mostly initialized and ready for extension.

NAME_ReceiverAdded

The extension system allows registering for arbitrary event callbacks on receiver actors.

NAME_ReceiverRemoved

RemoveReceiver was called for a registered class and components were removed, normally called from EndPlay