This commit is contained in:
2026-04-30 16:52:19 +07:00
parent 0542f5656f
commit 4709fa0c55
6 changed files with 95 additions and 29 deletions

View File

@@ -236,7 +236,13 @@ namespace Hallucinate.UI
: null;
bool success = await spawner.StartHost(id, name, pass);
if (success) ShowLounge(name);
if (success)
{
ShowLounge(name);
// Explicitly push the LobbyController to ensure it's the active UI screen.
// This helps prevent unintended navigation away from the lounge.
await uiManager.Push<LobbyController>();
}
}
private void UpdateRoomList(List<SessionInfo> sessions)
@@ -319,12 +325,12 @@ namespace Hallucinate.UI
BasicSpawner.Instance?.StartGame();
}
private void OnLeaveLoungeClicked()
private async void OnLeaveLoungeClicked()
{
var runner = Object.FindFirstObjectByType<NetworkRunner>();
if (runner != null)
{
runner.Shutdown();
await runner.Shutdown();
}
if (_playerDataManager != null)
{
@@ -355,7 +361,7 @@ namespace Hallucinate.UI
}
}
if (_playerDataManager == null || !_playerDataManager.Object.IsValid) return;
if (_playerDataManager == null || _playerDataManager.Object == null || !_playerDataManager.Object.IsValid) return;
PlayerRef hostRef = PlayerRef.None;
PlayerRef guestRef = PlayerRef.None;