You've already forked LuckyWorld
Rename entire project to LuckyWorldV2, including uproject file, folders and so on
This commit is contained in:
@ -0,0 +1,37 @@
|
||||
// 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* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
|
||||
if (GameInstance)
|
||||
{
|
||||
CurrentRobot = GameInstance->CurrentSelectRobot;
|
||||
}
|
||||
if (CurrentRobot != ERobotsName::None)
|
||||
{
|
||||
TArray<FRobotData> ActiveRobotDataList = ULuckyRobotsFunctionLibrary::GetActiveRobotDataList(this);
|
||||
for (const FRobotData& RobotData : ActiveRobotDataList)
|
||||
{
|
||||
if (RobotData.Name == CurrentRobot)
|
||||
{
|
||||
RobotClass = RobotData.RobotClass;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return RobotClass;
|
||||
}
|
Reference in New Issue
Block a user