Skip to content

Instantly share code, notes, and snippets.

@Tesladev2323
Created August 23, 2018 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tesladev2323/29cb9ce07f365d206453c1b044892536 to your computer and use it in GitHub Desktop.
Save Tesladev2323/29cb9ce07f365d206453c1b044892536 to your computer and use it in GitHub Desktop.
[End Result] Classic Camera C++ - CameraSwitchVolume.h
// 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