Skip to content

FlowPilotComponent.h

File Info

FileName: FlowPilotComponent.h

UFlowPilotComponent

Parent Classes: [ UActorComponent ]

FlowPilotComponent initializes, maintains and runs a FlowPilot Data Asset.

Properties

// Delegate that indicates a FlowState Chane (OldFlowState, NewFlowState)
UPROPERTY(BlueprintAssignable, Category="FlowPilot")
FFlowStateChangedSignature OnFlowStateChanged;
// Delegate indicating Flow Started
UPROPERTY(BlueprintAssignable, Category="FlowPilot")
FFlowStartedSignature OnFlowStarted;
// Delegate indicating Flow Paused
UPROPERTY(BlueprintAssignable, Category="FlowPilot")
FFlowPausedSignature OnFlowPaused;
// Delegate indicating Flow Error
UPROPERTY(BlueprintAssignable, Category="FlowPilot")
FFlowErrorSignature OnFlowError;
// Delegate indicating Flow Completed
UPROPERTY(BlueprintAssignable, Category="FlowPilot")
FFlowCompletedSignature OnFlowCompleted;
// Automatically starts FlowPilot on BeginPlay
UPROPERTY(EditAnywhere, Category=FlowPilot)
uint8 bAutoStartOnBeginPlay : 1;
// FlowPilot Asset.
UPROPERTY(EditAnywhere, Category=FlowPilot)
TObjectPtr<UFlowPilot> FlowPilotAsset;
// Overrides FlowPilotAsset with ExecutionMode
UPROPERTY(EditAnywhere, Category=FlowPilot)
EFPExecutionMode ExecutionMode = EFPExecutionMode::RunOnce;
// Execution Mode retry delay
UPROPERTY(EditAnywhere, Category=FlowPilot, meta=(ClampMin="0.0", EditCondition="ExecutionMode != EFPExecutionMode::RunOnce"))
float RetryDelay = 0.0f;
// FlowPilotLifetimeActors are spawned from FlowPilot, and will auto destroy when Ending
TArray<TWeakObjectPtr<AActor>> FlowPilotLifetimeActors;

Functions

SetFlowPilotAsset

Sets FlowPilot data asset

bool SetFlowPilotAsset(UFlowPilot* InFlowPilotAsset);

StartFlow

Start Current FlowPilot

void StartFlow();

StopFlow

Stops FlowPilot

void StopFlow(EFPStopType StopType = EFPStopType::CancelExecution);

PauseFlow

Pauses FlowPilot. Execution must have been started first

void PauseFlow();

UnPauseFlow

UnPauses FlowPilot, if Paused.

void UnPauseFlow();

IsPaused

Returns true if FlowPilot is Paused

bool IsPaused() const { return FlowState == EFlowState::Paused; }

IsDataSetup

Returns true if FlowPilotComponent has a FlowPilotAsset assigned.

bool IsDataSetup() const { return FlowPilotAsset != nullptr; }

GetRunState

Returns FlowPilot Run State

EFlowState GetRunState() const { return FlowState; }

IsRunning

Returns true if FlowPilot’s run state is in Progress

bool IsRunning() const { return FlowState == EFlowState::InProgress; }

FindSingleActor

Find a single actor from a FlowActorReference.
If there are multiple assigned to this reference, a warning will show up, and the first result returned

AActor* FindSingleActor(const FFlowActorReference& ActorReference);

FindActors

Finds all actors from a FlowActorReference

TArray<AActor*> FindActors(const FFlowActorReference& ActorReference);

FindSingleActorByTag

Finds and Caches Unique Actor via GameplayTag

AActor* FindSingleActorByTag(const FGameplayTag& Tag);

FindActorsByTag

Find and Caches all Actors by Tag

TArray<AActor*> FindActorsByTag(const FGameplayTag& Tag);

BindToFlowPilotLifetime

Binds Lifetime of Actor to FlowPilot.
‘InActor’ will automatically be destroyed when FlowPilot execution ends.

void BindToFlowPilotLifetime(AActor* InActor);

PrefetchActorReference

Adds ‘ActorReference’ to list of actors that will be prefetched on ‘Setup

void PrefetchActorReference(const FFlowActorReference& ActorReference);

CacheTaggedActor

Caches ‘InActor’ with its associated unique tag ‘InGameplayTag’

void CacheTaggedActor(AActor* InActor, const FGameplayTag& InGameplayTag);

GetFlowPilotName

Returns FlowPilot Data assets’s name.

FString GetFlowPilotName() const;