Produktion_Digitaler_Medien/Source/BuildingEscape/OpenDoor.h

45 lines
957 B
C
Raw Normal View History

2020-10-08 15:33:58 +02:00
#pragma once
#include "CoreMinimal.h"
2020-12-03 14:12:54 +01:00
#include "RotatingActor.h"
2020-10-08 15:33:58 +02:00
#include "Components/AudioComponent.h"
#include "Components/ActorComponent.h"
#include "Engine/TriggerVolume.h"
//#include "Engine/ActorChannel.h"
#include "OpenDoor.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
2020-12-03 14:12:54 +01:00
class BUILDINGESCAPE_API UOpenDoor : public URotatingActor
2020-10-08 15:33:58 +02:00
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
UOpenDoor();
protected:
// Called when the game starts
virtual void BeginPlay() override;
public:
// Called every frame
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
2020-12-03 14:12:54 +01:00
void OpenDoor();
void CloseDoor();
2020-10-08 15:33:58 +02:00
float TotalMass() const;
private:
2020-12-03 14:12:54 +01:00
bool open = false;
float doorLastOpened;
2020-10-08 15:33:58 +02:00
UPROPERTY(EditAnywhere)
float MassToOpenDoor = 50.f;
UPROPERTY(EditAnywhere)
ATriggerVolume* PressurePlate = nullptr;
};