8#include "CoreMinimal.h"
9#include "GameFramework/Pawn.h"
10#include "Engine/World.h"
20#include "Vehicle.generated.h"
22class UNiagaraComponent;
23class USensorsManagerComponent;
50 UFUNCTION(BlueprintCallable)
60 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
61 void TogglePhysics(
bool isOn);
69 UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
70 void TeleportVehicleTo(FVector NewLocation, FRotator NewRotation);
77 virtual
void TeleportVehicleTo_Implementation(FVector NewLocation, FRotator NewRotation);
82 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
89 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
90 void ToggleLights(
bool isOn);
96 UFUNCTION(BlueprintCallable)
97 void SetVisualizeVehicleOverlapArea(
bool Visible);
104 UFUNCTION(BlueprintCallable)
111 UFUNCTION(BlueprintCallable)
112 void SetVehicleIsInGarage(
bool VehicleIsInGarage)
114 VehicleInGarage = VehicleIsInGarage;
115 OnVehicleGarageChanged.Broadcast(VehicleInGarage);
122 UFUNCTION(BlueprintPure)
123 bool IsVehicleInGarage()
const
125 return VehicleInGarage;
132 UFUNCTION(BlueprintCallable)
133 USensorsManagerComponent* GetSensorsManager()
const
135 return SensorsManager;
142 UFUNCTION(BlueprintPure)
145 return CollisionSensor;
152 UFUNCTION(BlueprintPure)
155 return TransformSensor;
162 UFUNCTION(BlueprintPure)
165 return OverlapSensor;
172 UFUNCTION(BlueprintPure)
173 FTransform GetMovedFromGarageTransform()
const
175 return MovedFromGarageTransform;
178 UFUNCTION(BlueprintCallable)
179 virtual
void SetCurrentTransformToMovedFromGarageTransform()
181 MovedFromGarageTransform = GetTransform();
186 return InteractableName;
191 return GetActorTransform();
207 const FString ID = IActorInformation::Execute_GetActorID(
this);
208 const FString Name = IActorInformation::Execute_GetActorName(
this);
209 const FTransform VehicleTransform = GetActorTransform();
210 const FVector Location = VehicleTransform.GetLocation();
211 const FRotator Rotation = VehicleTransform.Rotator();
212 FString Information = FString::Printf(TEXT(
"Vehicle: %s, Name: %s, ID: %s, Location: %s, Rotation: %s"), *
Vehicle, *Name, *ID, *Location.ToString(), *Rotation.ToString());
219 ActorName = NewActorName;
224 ActorName = NewActorName;
232 UFUNCTION(BlueprintCallable)
235 VehicleParameters = NewParameters;
236 ApplyVehicleParameters(VehicleParameters);
242 UFUNCTION(BlueprintPure)
245 return VehicleParameters;
251 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
254 virtual
void PossessedBy(AController* NewController) override;
256 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interactable")
257 FText InteractableName;
259 UPROPERTY(BlueprintAssignable)
260 FVehicleGarageChangedDelegate OnVehicleGarageChanged;
266 virtual
void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
271 UPROPERTY(Category =
Vehicle, VisibleAnywhere, BlueprintReadWrite)
277 UPROPERTY(Category =
Vehicle, VisibleAnywhere, BlueprintReadOnly)
278 TObjectPtr<USensorsManagerComponent> SensorsManager;
280 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
283 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
286 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
289 UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
290 UNiagaraComponent* NiagaraComponent =
nullptr;
292 UPROPERTY(VisibleAnywhere)
295 UPROPERTY(VisibleAnywhere)
298 UPROPERTY(EditAnywhere, BlueprintReadWrite)
299 FTransform OriginalCameraTransform;
301 FTransform MovedFromGarageTransform;
303 bool VehicleInGarage = false;
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 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)