Produktion_Digitaler_Medien/Source/BuildingEscape/OpenDoor.h

45 lines
957 B
C++

#pragma once
#include "CoreMinimal.h"
#include "RotatingActor.h"
#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) )
class BUILDINGESCAPE_API UOpenDoor : public URotatingActor
{
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;
void OpenDoor();
void CloseDoor();
float TotalMass() const;
private:
bool open = false;
float doorLastOpened;
UPROPERTY(EditAnywhere)
float MassToOpenDoor = 50.f;
UPROPERTY(EditAnywhere)
ATriggerVolume* PressurePlate = nullptr;
};