Produktion_Digitaler_Medien/Source/BuildingEscape/TriggerOpenDoor.h

43 lines
1.1 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "Components/AudioComponent.h"
#include "Engine/TriggerVolume.h"
#include "TriggerOpenDoor.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class BUILDINGESCAPE_API UTriggerOpenDoor : public UActorComponent
{
GENERATED_BODY()
public:
UTriggerOpenDoor();
virtual void TickComponent(float DeltaTime, ELevelTick TickType,
FActorComponentTickFunction* ThisTickFunction) override;
UPROPERTY(EditAnywhere)
FRotator TargetRotation = FRotator(90.0f, 0.0f, 0.0f);
UPROPERTY(EditAnywhere)
FRotator TargetSpeed = FRotator(1.0f, 0.0f, 0.0f);
UPROPERTY(EditAnywhere)
ATriggerVolume * TriggerVolume = nullptr;
UPROPERTY(EditAnywhere)
UAudioComponent * AudioComponent = nullptr;
protected:
virtual void BeginPlay() override;
private:
bool doorOpen = false;
bool opening = false;
FRotator currentRotation;
};