Optimizing WB_MainScreen

This commit is contained in:
martinluckyrobots
2025-04-10 10:50:58 +08:00
parent 28c87e6f85
commit 55fabb31e8
6 changed files with 171 additions and 13 deletions

View File

@ -16,7 +16,8 @@ UClass* ALuckyRobotsGameMode::GetDefaultPawnClassForController_Implementation(AC
UClass* RobotClass = Super::GetDefaultPawnClassForController_Implementation(InController);
ERobotsName CurrentRobot = ERobotsName::None;
if (ULuckyRobotsGameInstance* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance()))
ULuckyRobotsGameInstance* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
if (GameInstance)
{
CurrentRobot = GameInstance->CurrentSelectRobot;
}