// Copyright Epic Games, Inc. All Rights Reserved. #include "ProjectFishGameMode.h" #include "ProjectFishPlayerController.h" #include "ProjectFishCharacter.h" #include "Settings/GameConfigSettings.h" #include "UObject/ConstructorHelpers.h" AProjectFishGameMode::AProjectFishGameMode() { // use our custom PlayerController class PlayerControllerClass = AProjectFishPlayerController::StaticClass(); // set default pawn class to our Blueprinted character static ConstructorHelpers::FClassFinder PlayerPawnBPClass(TEXT("/Game/TopDown/Blueprints/BP_TopDownCharacter")); if (PlayerPawnBPClass.Class != nullptr) { DefaultPawnClass = PlayerPawnBPClass.Class; } // set default controller to our Blueprinted controller static ConstructorHelpers::FClassFinder PlayerControllerBPClass(TEXT("/Game/TopDown/Blueprints/BP_TopDownPlayerController")); if(PlayerControllerBPClass.Class != NULL) { PlayerControllerClass = PlayerControllerBPClass.Class; } } void AProjectFishGameMode::BeginPlay() { Super::BeginPlay(); const UGameConfigSettings* ConfigSettings = GetDefault(); FTimerHandle FishingTimerHandle; GetWorld()->GetTimerManager().SetTimer(FishingTimerHandle, [this]() { this->bBattleIsBegin = true; }, ConfigSettings->BattaleWatingTime, false); } bool AProjectFishGameMode::GetBattleIsBegin() const { return bBattleIsBegin; }