Navigation
API > API/Runtime > API/Runtime/GameplayTasks
Inheritance Hierarchy
- UActorComponent
- IGameplayTaskOwnerInterface
- IVisualLoggerDebugSnapshotInterface
- UGameplayTasksComponent
References
| Module | GameplayTasks |
| Header | /Engine/Source/Runtime/GameplayTasks/Classes/GameplayTasksComponent.h |
| Include | #include "GameplayTasksComponent.h" |
Syntax
UCLASS (ClassGroup=GameplayTasks,
HideCategories=(Object, LOD, Lighting, Transform, Sockets, TextureStreaming),
EditInlineNew, Meta=(BlueprintSpawnableComponent), MinimalAPI)
class UGameplayTasksComponent :
public UActorComponent,
public IGameplayTaskOwnerInterface ,
public IVisualLoggerDebugSnapshotInterface
Remarks
The core ActorComponent for interfacing with the GameplayAbilities System
Variables
| Type | Name | Description | |
|---|---|---|---|
| FGameplayResourceSet | CurrentlyClaimedResources | Resources used by currently active tasks | |
| TArray< TObjectPtr< UGameplayTask > > | KnownTasks | All known tasks (processed by this component) referenced for GC | |
| FOnClaimedResourcesChangeSignature | OnClaimedResourcesChange | ||
| TArray< FGameplayTaskEventData > | TaskEvents | Transient array of events whose main role is to avoid long chain of recurrent calls if an activated/paused/removed task wants to push/pause/kill other tasks. | |
| TArray< TObjectPtr< UGameplayTask > > | TaskPriorityQueue | ||
| TArray< TObjectPtr< UGameplayTask > > | TickingTasks | Array of currently active UGameplayTask that require ticking | |
| uint8 | TopActivePriority | Indicates what's the highest priority among currently running tasks |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UGameplayTasksComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | AddSimulatedTask
(
UGameplayTask* NewTask |
Add a new simulated task. | |
| void | AddTaskReadyForActivation
(
UGameplayTask& NewTask |
Processes the task and figures out if it should get triggered instantly or wait based on task's RequiredResources, Priority and ResourceOverlapPolicy | |
| void | DescribeSelfToVisLog
(
FVisualLogEntry* Snapshot |
||
| void | EndAllResourceConsumingTasksOwnedBy
(
const IGameplayTaskOwnerInterface& TaskOwner |
||
| bool | FindAllResourceConsumingTasksOwnedBy
(
const IGameplayTaskOwnerInterface& TaskOwner, |
||
| UGameplayTask * | FindResourceConsumingTaskByName
(
const FName TaskInstanceName |
Finds first resource-consuming task of given name | |
| FGameplayResourceSet | |||
| GameplayTaskContainerType::TConstIterator | |||
| FString | |||
| void | GetLifetimeReplicatedProps
(
TArray< FLifetimeProperty >& OutLifetimeProps |
||
| GameplayTaskContainerType::TConstIterator | |||
| bool | Retrieves information whether this component should be ticking taken current activity into consideration | ||
| GameplayTaskContainerType::TConstIterator | |||
| const TArray< UGameplayTask * > & | Tasks that run on simulated proxies | ||
| TArray< TObjectPtr< UGameplayTask > > & | |||
| FString | |||
| FString | GetTaskStateName
(
EGameplayTaskState Value |
||
| GameplayTaskContainerType::TConstIterator | |||
| FString | |||
| void | GrabDebugSnapshot
(
FVisualLogEntry* Snapshot |
||
| bool | HasActiveTasks
(
UClass* TaskClass |
||
| EGameplayTaskRunResult | K2_RunGameplayTask
(
TScriptInterface< IGameplayTaskOwnerInterface > TaskOwner, |
||
| void | OnRep_SimulatedTasks
(
const TArray< UGameplayTask* >& PreviousSimulatedTasks |
||
| void | |||
| void | |||
| void | RemoveResourceConsumingTask
(
UGameplayTask& Task |
||
| void | RemoveSimulatedTask
(
UGameplayTask* NewTask |
Remove an existing simulated task | |
| bool | ReplicateSubobjects
(
UActorChannel* Channel, |
||
| void | |||
| EGameplayTaskRunResult | RunGameplayTask
(
IGameplayTaskOwnerInterface& TaskOwner, |
||
| void | SetCurrentlyClaimedResources
(
FGameplayResourceSet NewClaimedSet |
||
| void | SetSimulatedTasks
(
const TArray< UGameplayTask* >& NewSimulatedTasks |
Remove all current tasks and register the one in the passed array. | |
| void | TickComponent
(
float DeltaTime, |
||
| void | |||
| void |
Overridden from IGameplayTaskOwnerInterface
| Type | Name | Description | |
|---|---|---|---|
| AActor * | GetGameplayTaskAvatar
(
const UGameplayTask* Task |
Get "body" of task's owner / default, having location in world (e.g. Owner = AIController, Avatar = Pawn) | |
| AActor * | GetGameplayTaskOwner
(
const UGameplayTask* Task |
Get owner of a task or default one when task is null | |
| UGameplayTasksComponent * | GetGameplayTasksComponent
(
const UGameplayTask& Task |
Finds tasks component for given GameplayTask, Task.GetGameplayTasksComponent() may not be initialized at this point! | |
| void | OnGameplayTaskActivated
(
UGameplayTask& Task |
Notify called after GameplayTask changes state to Active (initial activation or resuming) | |
| void | OnGameplayTaskDeactivated
(
UGameplayTask& Task |
Notify called after GameplayTask changes state from Active (finishing or pausing) |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FEventLock |
Typedefs
| Name | Description |
|---|---|
| GameplayTaskContainerType |