Produktion_Digitaler_Medien/Source/BuildingEscape/TriggerOpenDoor.h

43 lines
1.1 KiB
C
Raw Normal View History

2020-12-01 11:32:20 +01:00
// 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)
2020-12-01 18:30:41 +01:00
FRotator TargetRotation = FRotator(00.0f, 90.0f, 0.0f);
2020-12-01 11:32:20 +01:00
UPROPERTY(EditAnywhere)
2020-12-01 18:30:41 +01:00
FRotator TargetSpeed = FRotator(0.0f, 1.0f, 0.0f);
2020-12-01 11:32:20 +01:00
UPROPERTY(EditAnywhere)
ATriggerVolume * TriggerVolume = nullptr;
UPROPERTY(EditAnywhere)
UAudioComponent * AudioComponent = nullptr;
protected:
virtual void BeginPlay() override;
private:
bool doorOpen = false;
bool opening = false;
FRotator currentRotation;
};