Navigation
API > API/Runtime > API/Runtime/GameplayTasks
Adds time limit for running a child task
- child task needs to be created with UGameplayTask_TimeLimitedExecution passed as TaskOwner
- activations are tied together and when either UGameplayTask_TimeLimitedExecution or child task is activated, other one starts as well
- OnFinished and OnTimeExpired are mutually exclusive
| Name | UGameplayTask_TimeLimitedExecution |
| Type | class |
| Header File | /Engine/Source/Runtime/GameplayTasks/Classes/Tasks/GameplayTask_TimeLimitedExecution.h |
| Include Path | #include "Tasks/GameplayTask_TimeLimitedExecution.h" |
Syntax
UCLASS (MinimalAPI)
class UGameplayTask_TimeLimitedExecution : public UGameplayTask
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UGameplayTask → UGameplayTask_TimeLimitedExecution
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UGameplayTask_TimeLimitedExecution
(
const FObjectInitializer& ObjectInitializer |
Tasks/GameplayTask_TimeLimitedExecution.h |
Classes
| Name | Remarks |
|---|---|
| FTaskFinishDelegate |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| OnFinished | FTaskFinishDelegate | Called when child task finishes execution before time runs out | Tasks/GameplayTask_TimeLimitedExecution.h |
|
| OnTimeExpired | FTaskFinishDelegate | Called when time runs out | Tasks/GameplayTask_TimeLimitedExecution.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bChildTaskFinished | uint32 | Tasks/GameplayTask_TimeLimitedExecution.h | ||
| bTimeExpired | uint32 | Tasks/GameplayTask_TimeLimitedExecution.h | ||
| Time | double | Tasks/GameplayTask_TimeLimitedExecution.h | ||
| TimeStarted | double | Tasks/GameplayTask_TimeLimitedExecution.h |
Functions
Public
Overridden from UGameplayTask
| 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 | Tasks/GameplayTask_TimeLimitedExecution.h | |
virtual FString GetDebugString() |
Return debug string describing task | Tasks/GameplayTask_TimeLimitedExecution.h |
Overridden from IGameplayTaskOwnerInterface
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void OnGameplayTaskActivated
(
UGameplayTask& Task |
Notify called after GameplayTask changes state to Active (initial activation or resuming) | Tasks/GameplayTask_TimeLimitedExecution.h | |
virtual void OnGameplayTaskDeactivated
(
UGameplayTask& Task |
Notify called after GameplayTask changes state from Active (finishing or pausing) | Tasks/GameplayTask_TimeLimitedExecution.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static UGameplayTask_TimeLimitedExecution * LimitExecutionTime
(
IGameplayTaskOwnerInterface& InTaskOwner, |
Tasks/GameplayTask_TimeLimitedExecution.h |