Navigation
API > API/Plugins > API/Plugins/ModularGameplay > API/Plugins/ModularGameplay/Components
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- USubsystem
- UGameInstanceSubsystem
- UGameFrameworkComponentManager
References
| Module | ModularGameplay |
| Header | /Engine/Plugins/Experimental/ModularGameplay/Source/ModularGameplay/Public/Components/GameFrameworkComponentManager.h |
| Include | #include "Components/GameFrameworkComponentManager.h" |
Syntax
UCLASS&40;&41;
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
| Type | Name | Description | |
|---|---|---|---|
| TSharedPtr< FComponentRequestHandle > | AddComponentRequest
(
const TSoftClassPtr< AActor >& ReceiverClass, |
Adds a request to instantiate components on actors of the given classes. | |
| TSharedPtr< FComponentRequestHandle > | AddExtensionHandler
(
const TSoftClassPtr< AActor >& ReceiverClass, |
Adds an extension handler to run on actors of the given class. | |
| void | AddGameFrameworkComponentReceiver
(
AActor* Receiver, |
Adds an actor as a receiver for components (automatically finding the manager for the actor's game instance). | |
| void | AddReceiver
(
AActor* Receiver, |
Adds an actor as a receiver for components. | |
| void | AddReferencedObjects
(
UObject* InThis, |
||
| bool | ChangeFeatureInitState
(
AActor* Actor, |
Changes the current actor feature state, this will call registered callbacks and return true if anything changed | |
| void | |||
| void | GetAllFeatureImplementers
(
TArray< UObject* >& OutImplementers, |
Gets all implementing objects for an actor that are at RequiredState or later, other than excluding feature if specified | |
| UGameFrameworkComponentManager * | GetForActor
(
const AActor* Actor, |
Utility to get this manager from an actor, will return null if actor is null or not in a world | |
| UObject * | GetImplementerForFeature
(
AActor* Actor, |
Returns the object implementing specified feature, filtered by required state if not none | |
| FGameplayTag | GetInitStateForFeature
(
AActor* Actor, |
Returns the earliest state found for the given feature | |
| bool | HasFeatureReachedInitState
(
AActor* Actor, |
Returns true if feature has reached query state or later | |
| bool | HaveAllFeaturesReachedInitState
(
AActor* Actor, |
Checks to see if all features of object, other than the excluding feature if specified, have reached a specified state or later | |
| bool | IsInitStateAfterOrEqual
(
FGameplayTag FeatureState, |
Returns true if FeatureState comes after the second state (or is equal) | |
| FDelegateHandle | RegisterAndCallForActorInitState
(
AActor* Actor, |
Registers native delegate for feature state change notifications on a specific actor and may call it immediately | |
| bool | RegisterAndCallForActorInitState
(
AActor* Actor, |
Registers blueprint delegate for feature state change notifications on a specific actor and may call it immediately | |
| FDelegateHandle | RegisterAndCallForClassInitState
(
const TSoftClassPtr< AActor >& ActorClass, |
Registers native delegate for feature state change notifications on a class of actors and may call it immediately | |
| bool | RegisterAndCallForClassInitState
(
TSoftClassPtr< AActor > ActorClass, |
Registers blueprint delegate for feature state change notifications on a class of actors and may call it immediately | |
| bool | RegisterFeatureImplementer
(
AActor* Actor, |
Registers an implementer for a given feature, this will create a feature if required and set the implementer object but will not change the current state | |
| void | RegisterInitState
(
FGameplayTag NewState, |
The init state system can be used by components to coordinate their initialization using game-specific states specified as gameplay tags IGameFrameworkInitStateInterface provides a simple implementation that can be inherted by components Adds a new global actor feature state, either before or after an existing one. | |
| void | RemoveActorFeatureData
(
AActor* Actor |
Removes an actor and all of it's state information | |
| void | RemoveFeatureImplementer
(
AActor* Actor, |
Removes an implementing object and any feature states it implements | |
| void | RemoveGameFrameworkComponentReceiver
(
AActor* Receiver |
Removes an actor as a receiver for components (automatically finding the manager for the actor's game instance). | |
| void | RemoveReceiver
(
AActor* Receiver |
Removes an actor as a receiver for components. | |
| void | SendExtensionEvent
(
AActor* Receiver, |
Sends an arbitrary extension event that can be listened for by other systems | |
| void | SendGameFrameworkComponentExtensionEvent
(
AActor* Receiver, |
Sends an arbitrary extension event that can be listened for by other systems | |
| bool | UnregisterActorInitStateDelegate
(
AActor* Actor, |
Removes a registered delegate bound to a specific actor | |
| bool | UnregisterActorInitStateDelegate
(
AActor* Actor, |
Removes a registered delegate bound to a specific actor | |
| bool | UnregisterClassInitStateDelegate
(
const TSoftClassPtr< AActor >& ActorClass, |
Removes a registered delegate bound to a class | |
| bool | UnregisterClassInitStateDelegate
(
TSoftClassPtr< AActor > ActorClass, |
Removes a registered delegate bound to a class |
Overridden from USubsystem
| Type | Name | Description | |
|---|---|---|---|
| void | Deinitialize () |
Implement this for deinitialization of instances of the system | |
| void | Initialize
(
FSubsystemCollectionBase& Collection |
Implement this for initialization of instances of the system |
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 |