Advertisement
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 "GamePiece.h"
- // Sets default values
- AGamePiece::AGamePiece()
- {
- // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
- PrimaryActorTick.bCanEverTick = true;
- // Set the root scene component
- StaticMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("PieceMesh"));
- RootComponent = StaticMesh;
- UE_LOG(LogTemp, Warning, TEXT("One gempiece set!"));
- }
- // Called when the game starts or when spawned
- void AGamePiece::BeginPlay()
- {
- Super::BeginPlay();
- }
- // Called every frame
- void AGamePiece::Tick(float DeltaTime)
- {
- Super::Tick(DeltaTime);
- }
- // Sets the mesh of the gem piece
- void AGamePiece::SetMesh(UStaticMesh* Mesh)
- {
- StaticMesh->SetStaticMesh(Mesh);
- UE_LOG(LogTemp, Warning, TEXT("Mesh set!"));
- }
- // Handles click event
- void AGamePiece::ReceiveActorOnClicked(FKey ButtonPressed)
- {
- Super::ReceiveActorOnClicked(ButtonPressed);
- UE_LOG(LogTemp, Warning, TEXT("CLICK!"));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement