Navigation
API > API/Runtime > API/Runtime/GameplayTasks
| Name | UGameplayTask |
| Type | class |
| Header File | /Engine/Source/Runtime/GameplayTasks/Classes/GameplayTask.h |
| Include Path | #include "GameplayTask.h" |
Syntax
UCLASS (Abstract, BlueprintType, Meta=(ExposedAsyncProxy=AsyncTask), Config=Game, MinimalAPI)
class UGameplayTask :
public UObject ,
public IGameplayTaskOwnerInterface
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UGameplayTask
Implements Interfaces
Derived Classes
UGameplayTask derived class hierarchy
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UGameplayTask
(
const FObjectInitializer& ObjectInitializer |
GameplayTask.h |
Classes
| Name | Remarks |
|---|---|
| FGenericGameplayTaskDelegate |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| UGameplayTasksComponent | friend | GameplayTask.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddClaimedResource
(
TSubclassOf< UGameplayTaskResource > ClaimedResource |
GameplayTask.h | ||
void AddClaimedResource () |
GameplayTask.h | ||
void AddClaimedResourceSet
(
FGameplayResourceSet AdditionalResourcesToClaim |
GameplayTask.h | ||
void AddClaimedResourceSet
(
const TArray< TSubclassOf< UGameplayTaskResource > >& AdditionalResourcesToClaim |
GameplayTask.h | ||
void AddRequiredResource () |
GameplayTask.h | ||
void AddRequiredResource
(
TSubclassOf< UGameplayTaskResource > RequiredResource |
Marks this task as requiring specified resource which has a number of consequences, like task not being able to run if the resource is already taken. | GameplayTask.h | |
void AddRequiredResourceSet
(
const TArray< TSubclassOf< UGameplayTaskResource > >& RequiredResourceSet |
GameplayTask.h | ||
void AddRequiredResourceSet
(
FGameplayResourceSet RequiredResourceSet |
GameplayTask.h | ||
void EndTask () |
Called explicitly to end the task (usually by the task itself). | GameplayTask.h |
|
virtual void ExternalCancel () |
Called when the task is asked to cancel from an outside node. | GameplayTask.h | |
virtual void ExternalConfirm
(
bool bEndTask |
Called when the task is asked to confirm from an outside node. | GameplayTask.h | |
virtual FString GenerateDebugDescription() |
GameplayTask.h | ||
AActor * GetAvatarActor() |
Proper way to get the avatar actor associated with the task owner (usually a pawn, tower, etc) | GameplayTask.h | |
UGameplayTask * GetChildTask() |
GameplayTask.h | ||
FGameplayResourceSet GetClaimedResources() |
GameplayTask.h | ||
const FString & GetDebugDescription() |
GameplayTask.h | ||
virtual FString GetDebugString() |
Return debug string describing task | GameplayTask.h | |
| GameplayTask.h | |||
| GameplayTask.h | |||
FName GetInstanceName() |
GameplayTask.h | ||
AActor * GetOwnerActor () |
Proper way to get the owning actor of task owner. | GameplayTask.h | |
uint8 GetPriority() |
GameplayTask.h | ||
FGameplayResourceSet GetRequiredResources() |
GameplayTask.h | ||
ETaskResourceOverlapPolicy GetResourceOverlapPolicy() |
GameplayTask.h | ||
EGameplayTaskState GetState() |
GameplayTask.h | ||
IGameplayTaskOwnerInterface * GetTaskOwner() |
GameplayTask.h | ||
FString GetTaskStateName() |
GameplayTask.h | ||
virtual UWorld * GetWorld() |
Helper function for getting UWorld off a task | GameplayTask.h | |
bool HasOwnerFinished() |
GameplayTask.h | ||
virtual void InitSimulatedTask
(
UGameplayTasksComponent& InGameplayTasksComponent |
GameplayTask.h | ||
bool IsActive() |
GameplayTask.h | ||
bool IsFinished() |
GameplayTask.h | ||
bool IsOwnedByTasksComponent() |
GameplayTask.h | ||
bool IsPausable() |
GameplayTask.h | ||
bool IsPaused() |
GameplayTask.h | ||
bool IsSimulatedTask() |
GameplayTask.h | ||
bool IsSimulating() |
GameplayTask.h | ||
bool IsTickingTask() |
GameplayTask.h | ||
virtual bool IsWaitingOnAvatar() |
GameplayTask.h | ||
virtual bool IsWaitingOnRemotePlayerdata() |
GameplayTask.h | ||
void MarkOwnerFinished() |
Called when a task owner wants to inform the task that it's done and don't want to get notified on task deactivation (i.e. OnGameplayTaskDeactivated). | GameplayTask.h | |
void ReadyForActivation() |
Called to trigger the actual task once the delegates have been set up | GameplayTask.h |
|
bool RequiresPriorityOrResourceManagement() |
GameplayTask.h | ||
void TaskOwnerEnded() |
Called when task owner has "ended" (before the task ends) kills the task. Calls OnDestroy. | GameplayTask.h | |
virtual void TickTask
(
float DeltaTime |
Tick function for this task, if bTickingTask == true | GameplayTask.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool IsSupportedForNetworking() |
GameplayTask.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Activate() |
Called to trigger the actual task once the delegates have been set up Note that the default implementation does nothing and you don't have to call it | GameplayTask.h | |
void InitTask
(
IGameplayTaskOwnerInterface& InTaskOwner, |
Initializes the task with the task owner interface instance but does not activate until Activate() is called | GameplayTask.h | |
virtual void OnDestroy
(
bool bInOwnerFinished |
End and CleanUp the task - may be called by the task itself or by the task owner if the owner is ending. | GameplayTask.h | |
virtual void Pause() |
Protected by design. Not meant to be called outside from GameplayTaskComponent mechanics | GameplayTask.h | |
virtual void Resume() |
GameplayTask.h |
Overridden from IGameplayTaskOwnerInterface
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual AActor * GetGameplayTaskAvatar
(
const UGameplayTask* Task |
Get "body" of task's owner / default, having location in world (e.g. Owner = AIController, Avatar = Pawn) | GameplayTask.h | |
virtual uint8 GetGameplayTaskDefaultPriority() |
Get default priority for running a task | GameplayTask.h | |
virtual AActor * GetGameplayTaskOwner
(
const UGameplayTask* Task |
Get owner of a task or default one when task is null | GameplayTask.h | |
virtual UGameplayTasksComponent * GetGameplayTasksComponent
(
const UGameplayTask& Task |
Finds tasks component for given GameplayTask, Task.GetGameplayTasksComponent() may not be initialized at this point! | GameplayTask.h | |
virtual void OnGameplayTaskDeactivated
(
UGameplayTask& Task |
Notify called after GameplayTask changes state from Active (finishing or pausing) | GameplayTask.h | |
virtual void OnGameplayTaskInitialized
(
UGameplayTask& Task |
Notify called after GameplayTask finishes initialization (not active yet) | GameplayTask.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static IGameplayTaskOwnerInterface * ConvertToTaskOwner
(
UObject& OwnerObject |
GameplayTask.h | ||
static IGameplayTaskOwnerInterface * ConvertToTaskOwner
(
AActor& OwnerActor |
GameplayTask.h | ||
static T * NewTask
(
IGameplayTaskOwnerInterface& TaskOwner, |
GameplayTask.h | ||
static T * NewTask
(
TScriptInterface< IGameplayTaskOwnerInterface > TaskOwner, |
GameplayTask.h | ||
| Helper function for instantiating and initializing a new task | GameplayTask.h | ||
| GameplayTask.h | |||
static T * NewTaskUninitialized() |
Added for consistency with NewTask, but to indicate that a task requires manual call to InitTask This path is used to manually configure some aspects of the task, like Priority | GameplayTask.h |