You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
752 B
29 lines
752 B
2 years ago
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||
|
|
||
|
|
||
|
#include "MyPlayerController.h"
|
||
|
|
||
|
AMyPlayerController::AMyPlayerController() : Super(), isMyTurn(false) {
|
||
|
UE_LOG(LogTemp, Warning, TEXT("Player controller created"));
|
||
|
}
|
||
|
|
||
|
void AMyPlayerController::SetupInputComponent() {
|
||
|
Super::SetupInputComponent();
|
||
|
InputComponent->BindAction("MyAction", IE_Pressed, this,
|
||
|
&AMyPlayerController::OnLeftMouseClick);
|
||
|
}
|
||
|
|
||
|
void AMyPlayerController::StartTurn() {
|
||
|
isMyTurn = true;
|
||
|
UE_LOG(LogTemp, Warning, TEXT("Your turn"));
|
||
|
}
|
||
|
|
||
|
void AMyPlayerController::EndTurn() {
|
||
|
isMyTurn = false;
|
||
|
UE_LOG(LogTemp, Warning, TEXT("Not your turn"));
|
||
|
}
|
||
|
|
||
|
void AMyPlayerController::OnLeftMouseClick() {
|
||
|
UE_LOG(LogTemp, Warning, TEXT("Mouse clicked"));
|
||
|
}
|