44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "UTAD_UIGameMode.h"
|
|
#include "UTAD_UIPlayerController.h"
|
|
#include "UTAD_UICharacter.h"
|
|
#include "UObject/ConstructorHelpers.h"
|
|
|
|
AUTAD_UIGameMode::AUTAD_UIGameMode()
|
|
{
|
|
// use our custom PlayerController class
|
|
PlayerControllerClass = AUTAD_UIPlayerController::StaticClass();
|
|
|
|
// set default pawn class to our Blueprinted character
|
|
static ConstructorHelpers::FClassFinder<APawn> PlayerPawnBPClass(
|
|
TEXT("/Game/Blueprints/BP_MainCharacter"));
|
|
if (PlayerPawnBPClass.Class)
|
|
{
|
|
DefaultPawnClass = PlayerPawnBPClass.Class;
|
|
}
|
|
else
|
|
{
|
|
UE_LOG(
|
|
LogTemp, Error,
|
|
TEXT(
|
|
"AUTAD_UIGameMode::AUTAD_UIGameMode(): Failed to find BP_MainCharacter. Please ensure it exists"));
|
|
}
|
|
|
|
// set default controller to our Blueprinted controller
|
|
static ConstructorHelpers::FClassFinder<APlayerController>
|
|
PlayerControllerBPClass(
|
|
TEXT("/Game/Blueprints/BP_MainPlayerController"));
|
|
if (PlayerControllerBPClass.Class)
|
|
{
|
|
PlayerControllerClass = PlayerControllerBPClass.Class;
|
|
}
|
|
else
|
|
{
|
|
UE_LOG(
|
|
LogTemp, Error,
|
|
TEXT(
|
|
"AUTAD_UIGameMode::AUTAD_UIGameMode(): Failed to find BP_MainPlayerController. Please ensure it exists"));
|
|
}
|
|
}
|