You've already forked LuckyWorld
Fix Folder Structure
This commit is contained in:
40
Source/Luckyrobots/Private/GameModes/LuckyRobotsGameMode.cpp
Normal file
40
Source/Luckyrobots/Private/GameModes/LuckyRobotsGameMode.cpp
Normal file
@ -0,0 +1,40 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "GameModes/LuckyRobotsGameMode.h"
|
||||
#include "Core/LuckyRobotsGameInstance.h"
|
||||
#include "FunctionLibraries/LuckyRobotsFunctionLibrary.h"
|
||||
|
||||
void ALuckyRobotsGameMode::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
ULuckyRobotsFunctionLibrary::UpdateQualitySettings(this);
|
||||
}
|
||||
|
||||
UClass* ALuckyRobotsGameMode::GetDefaultPawnClassForController_Implementation(AController* InController)
|
||||
{
|
||||
UClass* RobotClass = Super::GetDefaultPawnClassForController_Implementation(InController);
|
||||
|
||||
ERobotsName CurrentRobot = ERobotsName::None;
|
||||
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
|
||||
if (LuckyRobotsGameInstance)
|
||||
{
|
||||
CurrentRobot = LuckyRobotsGameInstance->CurrentSelectRobot;
|
||||
}
|
||||
if (CurrentRobot != ERobotsName::None)
|
||||
{
|
||||
TArray<FRobotData> ActiveRobotDataList = ULuckyRobotsFunctionLibrary::GetActiveRobotDataList(this);
|
||||
for (auto ActiveRobotData : ActiveRobotDataList)
|
||||
{
|
||||
if (ActiveRobotData.Name == CurrentRobot)
|
||||
{
|
||||
RobotClass = ActiveRobotData.RobotClass;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return RobotClass;
|
||||
}
|
||||
|
Reference in New Issue
Block a user