Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.07 KB | None | 0 0
  1. // Fill out your copyright notice in the Description page of Project Settings.
  2.  
  3. #include "GamePiece.h"
  4.  
  5. // Sets default values
  6. AGamePiece::AGamePiece()
  7. {
  8.     // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
  9.     PrimaryActorTick.bCanEverTick = true;
  10.  
  11.     // Set the root scene component
  12.     StaticMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("PieceMesh"));
  13.     RootComponent = StaticMesh;
  14.  
  15.     UE_LOG(LogTemp, Warning, TEXT("One gempiece set!"));
  16. }
  17.  
  18. // Called when the game starts or when spawned
  19. void AGamePiece::BeginPlay()
  20. {
  21.     Super::BeginPlay();
  22. }
  23.  
  24. // Called every frame
  25. void AGamePiece::Tick(float DeltaTime)
  26. {
  27.     Super::Tick(DeltaTime);
  28. }
  29.  
  30. // Sets the mesh of the gem piece
  31. void AGamePiece::SetMesh(UStaticMesh* Mesh)
  32. {
  33.     StaticMesh->SetStaticMesh(Mesh);
  34.     UE_LOG(LogTemp, Warning, TEXT("Mesh set!"));
  35. }
  36.  
  37. // Handles click event
  38. void AGamePiece::ReceiveActorOnClicked(FKey ButtonPressed)
  39. {
  40.     Super::ReceiveActorOnClicked(ButtonPressed);
  41.  
  42.     UE_LOG(LogTemp, Warning, TEXT("CLICK!"));
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement