8#include "CoreMinimal.h"
9#include "GameFramework/Character.h"
17#include "Walker.generated.h"
35 UFUNCTION(BlueprintCallable)
36 virtual void PauseWalker();
38 UFUNCTION(BlueprintCallable)
39 virtual void ResumeWalker();
41 UFUNCTION(BlueprintCallable)
42 virtual void SetIgnoreInput(
bool IgnoreInput);
49 UFUNCTION(BlueprintCallable)
50 FString ExportToJsonFile(
const FString& FileName);
52 UFUNCTION(BlueprintCallable)
53 void DebugDrawLinesBetweenPoints(
float LifeTime = 10.0f);
55 UFUNCTION(BlueprintCallable)
58 SetWalkerParameters(newParameters);
59 OnWalkerParametersChanged.Broadcast(WalkerParameters);
64 WalkerParameters = InParameters;
67 UFUNCTION(BlueprintCallable)
73 UFUNCTION(BlueprintPure)
76 return WalkerParameters;
79 UFUNCTION(BlueprintCallable)
80 FTransform GetStartTransform()
const
82 if (!WalkerParameters.Points.IsEmpty())
84 return WalkerParameters.
Points[0];
87 return FTransform::Identity;
90 UFUNCTION(BlueprintCallable)
91 FTransform GetEndTransform()
const
93 if (!WalkerParameters.Points.IsEmpty())
95 return WalkerParameters.Points.Last();
98 return FTransform::Identity;
101 UFUNCTION(BlueprintPure)
102 bool IsWalkerPaused()
const
104 return WalkerIsPaused;
109 return InteractableName;
114 return GetActorTransform();
130 const FString ID = GetActorID_Implementation();
131 const FString Name = GetActorName_Implementation();
132 const FTransform VehicleTransform = GetActorTransform();
133 const FVector Location = VehicleTransform.GetLocation();
134 const FRotator Rotation = VehicleTransform.Rotator();
135 FString Information = FString::Printf(TEXT(
"Walker: %s, Name: %s, ID: %s, Location: %s, Rotation: %s"), *
Walker, *Name, *ID, *Location.ToString(), *Rotation.ToString());
142 ActorName = NewActorName;
147 ActorName = NewActorName;
149 SetAndValidateActorIDAndName(ActorName, ActorID, TWeakObjectPtr<AActor>(
this));
153 UPROPERTY(BlueprintAssignable)
154 FWalkerEventDelegate_ParametersChanged OnWalkerParametersChanged;
156 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interactable")
157 FText InteractableName;
161 virtual
void BeginPlay() override;
163 virtual
void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
165 UPROPERTY(VisibleAnywhere)
168 UPROPERTY(VisibleAnywhere)
173 UPROPERTY(VisibleAnywhere, Category = "Walker")
174 bool WalkerIsPaused = true;
176 UPROPERTY(VisibleAnywhere, Category = "Walker")
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FWalkerEventDelegate_ParametersChanged, FWalkerParameters, NewWalkerParameters)
virtual FString GetActorID_Implementation() const override
virtual FTransform GetInteractableWorldTransform_Implementation() const override
void SetWalkerParameters(const FWalkerParameters &InParameters)
virtual void SetActorName_Implementation(const FString &NewActorName) override
virtual FString GetActorName_Implementation() const override
virtual void SetActorIDAndName_Implementation(const FString &NewActorName, const FString &NewID) override
virtual FString GetActorInformation_Implementation() const override
virtual FText GetInteractableName_Implementation() const override
static FString ConvertWalkerTypeToString(EWalkerType WalkerType)
TArray< FTransform > Points