Produktion_Digitaler_Medien/Source/BuildingEscape/ExtraSpecialRotatingDoor.h

54 lines
1.2 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "ExtraSpecialRotatingDoor.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class BUILDINGESCAPE_API UExtraSpecialRotatingDoor : public UActorComponent
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
UExtraSpecialRotatingDoor();
protected:
virtual void BeginPlay() override;
void Rotate(FRotator TargetRotation);
UFUNCTION(BlueprintCallable)
void Rotate();
public:
virtual void TickComponent(float DeltaTime, ELevelTick TickType,
FActorComponentTickFunction* ThisTickFunction) override;
UPROPERTY(EditAnywhere)
float TargetAnglePitch = 90.0f;
UPROPERTY(EditAnywhere)
float TargetAngleRoll = 90.0f;
UPROPERTY(EditAnywhere)
float RotationSpeed = 15.f;
UPROPERTY(EditAnywhere)
float RotationDelay = 0.f;
UPROPERTY(EditAnywhere)
bool Negative = false;
private:
FRotator targetRotation;
bool rotating;
bool soundHasBeenPlayed;
float tempPitchRotation;
float tempRollRotation;
void Move(FRotator TargetRotation);
};