-
-
Save Tesladev2323/29cb9ce07f365d206453c1b044892536 to your computer and use it in GitHub Desktop.
[End Result] Classic Camera C++ - CameraSwitchVolume.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fill out your copyright notice in the Description page of Project Settings. | |
#pragma once | |
#include "CoreMinimal.h" | |
#include "GameFramework/Actor.h" | |
#include "CameraSwitchVolume.generated.h" | |
// Forward Declarations | |
class UBoxComponent; | |
class UTextRenderComponent; | |
class APlayerCamera; | |
UCLASS() | |
class CLASSICCAMERATUT_API ACameraSwitchVolume : public AActor | |
{ | |
GENERATED_BODY() | |
public: | |
// Sets default values for this actor's properties | |
ACameraSwitchVolume(); | |
// Components | |
UBoxComponent* BoxCollision; | |
UTextRenderComponent* TextRenderNewCamera; | |
UTextRenderComponent* TextRenderPreviousCamera; | |
protected: | |
// Called when the game starts or when spawned | |
virtual void BeginPlay() override; | |
public: | |
// Called every frame | |
virtual void Tick(float DeltaTime) override; | |
// Construction Script | |
virtual void OnConstruction(const FTransform& Transform); | |
// Properties | |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Volume") | |
float VolumeWidth = 32.0f; | |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Volume") | |
float VolumeHeight = 32.0f; | |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cameras") | |
APlayerCamera* NewCamera; | |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cameras") | |
APlayerCamera* PreviousCamera; | |
// Overlap Event | |
UFUNCTION() | |
void OnEndOverlap(class AActor* ThisActor, class AActor* OtherActor); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment