8#include "CoreMinimal.h"
9#include "GameFramework/Pawn.h"
10#include "Engine/World.h"
19#include "Vehicle.generated.h"
21class UNiagaraComponent;
22class USensorsManagerComponent;
49 UFUNCTION(BlueprintCallable)
58 UFUNCTION(BlueprintPure)
61 return FString(TEXT(
"Undefined"));
68 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
69 void TogglePhysics(
bool isOn);
77 UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
78 void TeleportVehicleTo(FVector NewLocation, FRotator NewRotation);
85 virtual
void TeleportVehicleTo_Implementation(FVector NewLocation, FRotator NewRotation);
90 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
97 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
98 void ToggleLights(
bool isOn);
104 UFUNCTION(BlueprintCallable)
105 void SetVisualizeVehicleOverlapArea(
bool Visible);
112 UFUNCTION(BlueprintCallable)
119 UFUNCTION(BlueprintCallable)
120 void SetVehicleIsInGarage(
bool VehicleIsInGarage)
122 VehicleInGarage = VehicleIsInGarage;
123 OnVehicleGarageChanged.Broadcast(VehicleInGarage);
130 UFUNCTION(BlueprintPure)
131 bool IsVehicleInGarage()
const
133 return VehicleInGarage;
140 UFUNCTION(BlueprintCallable)
141 USensorsManagerComponent* GetSensorsManager()
const
143 return SensorsManager;
150 UFUNCTION(BlueprintPure)
153 return CollisionSensor;
160 UFUNCTION(BlueprintPure)
163 return TransformSensor;
170 UFUNCTION(BlueprintPure)
173 return OverlapSensor;
181 UFUNCTION(BlueprintPure)
182 FTransform GetMovedFromGarageTransform()
const
184 return MovedFromGarageTransform;
187 UFUNCTION(BlueprintCallable)
188 void SetCurrentTransformToMovedFromGarageTransform()
190 MovedFromGarageTransform = GetTransform();
195 return InteractableName;
200 return GetActorTransform();
218 const FTransform VehicleTransform = GetActorTransform();
219 const FVector Location = VehicleTransform.GetLocation();
220 const FRotator Rotation = VehicleTransform.Rotator();
221 FString Information = FString::Printf(TEXT(
"Vehicle: %s, Name: %s, ID: %s, Location: %s, Rotation: %s"), *
Vehicle, *Name, *ID, *Location.ToString(), *Rotation.ToString());
228 ActorName = NewActorName;
233 ActorName = NewActorName;
238 virtual void PossessedBy(AController* NewController)
override;
240 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Interactable")
241 FText InteractableName;
243 UPROPERTY(BlueprintAssignable)
244 FVehicleGarageChangedDelegate OnVehicleGarageChanged;
251 virtual
void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
256 UPROPERTY(Category =
Vehicle, VisibleAnywhere, BlueprintReadOnly)
257 TObjectPtr<USensorsManagerComponent> SensorsManager;
259 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
262 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
265 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
268 UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
269 UNiagaraComponent* NiagaraComponent =
nullptr;
271 UPROPERTY(VisibleAnywhere)
274 UPROPERTY(VisibleAnywhere)
277 UPROPERTY(EditAnywhere, BlueprintReadWrite)
278 FTransform OriginalCameraTransform;
282 bool VehicleInGarage = false;
284 FTransform MovedFromGarageTransform;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FVehicleGarageChangedDelegate, bool, IsVehicleInGarage)
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override
virtual void BeginPlay() override
FString ExportToJsonFile(const FString &FileName)
virtual FString GetActorID_Implementation() const override
virtual FString GetTopicName()
virtual FString GetActorName_Implementation() const override
virtual FText GetInteractableName_Implementation() const override
virtual FString GetActorID_Implementation() const override
virtual void SetActorIDAndName_Implementation(const FString &NewActorName, const FString &NewID) override
virtual FString GetActorInformation_Implementation() const override
virtual FString GetActorName_Implementation() const override
virtual FTransform GetInteractableWorldTransform_Implementation() const override
virtual void SetActorName_Implementation(const FString &NewActorName) override
static FString ConvertVehicleTypeToString(EVehicleTypes VehicleType)