Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fill out your copyright notice in the Description page of Project Settings.
- #include "Grid.h"
- AGrid::AGrid()
- {
- // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
- UE_LOG(LogTemp, Warning, TEXT("Changing the tick"));
- PrimaryActorTick.bCanEverTick = false;
- UE_LOG(LogTemp, Warning, TEXT("Tick changed"));
- //We don't yet know what type of grid this is. This will be changed by the subclasses
- UE_LOG(LogTemp, Warning, TEXT("Setting the grid type"));
- GridType = EGridType::EUnknown;
- UE_LOG(LogTemp, Warning, TEXT("Grid type set"));
- //Create the static mesh component
- UE_LOG(LogTemp, Warning, TEXT("Creating default subobject"));
- GridMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("GridMesh"));
- UE_LOG(LogTemp, Warning, TEXT("Default subobject created"));
- //Base other stuff around this component. Not needed for our example, but we may come back to this
- UE_LOG(LogTemp, Warning, TEXT("Setting root component"));
- RootComponent = GridMesh;
- UE_LOG(LogTemp, Warning, TEXT("Root component set"));
- /* TODO: Set mobility to stationary for efficient lighting */
- }
- // Called when the game starts or when spawned
- void AGrid::BeginPlay()
- {
- Super::BeginPlay();
- }
- // Called every frame
- void AGrid::Tick(float DeltaTime)
- {
- Super::Tick(DeltaTime);
- }
- EGridType AGrid::GetGridType() const
- {
- return GridType;
- }
- FVector AGrid::GetGridOrigin() const
- {
- return GetActorLocation(); //This returns the rootcomponent's location relative to the centre of the actor, not our world location
- //return GridMesh->GetComponentLocation();
- }
Add Comment
Please, Sign In to add comment