39 - Seamless Travel and lobby
This commit is contained in:
parent
88ae3da92e
commit
712fdb652e
|
@ -9,7 +9,8 @@
|
||||||
"Type": "Runtime",
|
"Type": "Runtime",
|
||||||
"LoadingPhase": "Default",
|
"LoadingPhase": "Default",
|
||||||
"AdditionalDependencies": [
|
"AdditionalDependencies": [
|
||||||
"Engine"
|
"Engine",
|
||||||
|
"UMG"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
[/Script/EngineSettings.GameMapsSettings]
|
[/Script/EngineSettings.GameMapsSettings]
|
||||||
GameDefaultMap=/Game/Maps/GameStartupMap.GameStartupMap
|
GameDefaultMap=/Game/Maps/GameStartupMap.GameStartupMap
|
||||||
EditorStartupMap=/Game/Maps/GameStartupMap.GameStartupMap
|
EditorStartupMap=/Game/Maps/GameStartupMap.GameStartupMap
|
||||||
|
TransitionMap=/Game/Maps/TransitionMap.TransitionMap
|
||||||
|
|
||||||
[/Script/HardwareTargeting.HardwareTargetingSettings]
|
[/Script/HardwareTargeting.HardwareTargetingSettings]
|
||||||
TargetedHardwareClass=Desktop
|
TargetedHardwareClass=Desktop
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,22 @@
|
||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "LobbyGameMode.h"
|
||||||
|
|
||||||
|
#include "GameFramework/GameStateBase.h"
|
||||||
|
|
||||||
|
void ALobbyGameMode::PostLogin(APlayerController* NewPlayer)
|
||||||
|
{
|
||||||
|
Super::PostLogin(NewPlayer);
|
||||||
|
|
||||||
|
int32 NumberOfPlayers = GameState.Get()->PlayerArray.Num();
|
||||||
|
if (NumberOfPlayers == 2)
|
||||||
|
{
|
||||||
|
UWorld* World = GetWorld();
|
||||||
|
if (World)
|
||||||
|
{
|
||||||
|
bUseSeamlessTravel = true;
|
||||||
|
World->ServerTravel(FString("/Game/Maps/BlasterMap?listen"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "GameFramework/GameMode.h"
|
||||||
|
#include "LobbyGameMode.generated.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
UCLASS()
|
||||||
|
class BLASTER_API ALobbyGameMode : public AGameMode
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual void PostLogin(APlayerController* NewPlayer) override;
|
||||||
|
};
|
Loading…
Reference in New Issue