Added map
This commit is contained in:
@@ -11,25 +11,61 @@ namespace Subsystems
|
||||
private GameClient _gameClient;
|
||||
private Canvas _CreateJoinLobby;
|
||||
private Canvas _InLobby;
|
||||
public GameManager_UI(GameClient gameClient, Canvas CreateJoinLobby, Canvas InLobby)
|
||||
private Canvas _LoadingScreen;
|
||||
private Canvas _GameScreen;
|
||||
public GameManager_UI(GameClient gameClient, Canvas CreateJoinLobby, Canvas InLobby, Canvas LoadingScreen, Canvas GameScreen)
|
||||
{
|
||||
_gameClient = gameClient;
|
||||
_CreateJoinLobby = CreateJoinLobby;
|
||||
_LoadingScreen = LoadingScreen;
|
||||
_GameScreen = GameScreen;
|
||||
_InLobby = InLobby;
|
||||
_CreateJoinLobby.enabled = true;
|
||||
_InLobby.enabled = false;
|
||||
_GameScreen.enabled = false;
|
||||
_LoadingScreen.enabled = false;
|
||||
}
|
||||
public void UpdateLobbyUI()
|
||||
{
|
||||
_InLobby.enabled = true;
|
||||
_CreateJoinLobby.enabled = false;
|
||||
var playerList = _InLobby.transform.Find("PlayerList").GetComponent<TMPro.TMP_Text>();
|
||||
playerList.text = "";
|
||||
foreach (var player in _gameClient.CurrentLobbyState.Players)
|
||||
if (_gameClient.CurrentLobbyState == null)
|
||||
{
|
||||
playerList.text += player.DisplayName + "\n";
|
||||
_CreateJoinLobby.enabled = true;
|
||||
_InLobby.enabled = false;
|
||||
_GameScreen.enabled = false;
|
||||
_LoadingScreen.enabled = false;
|
||||
return;
|
||||
}
|
||||
_InLobby.transform.Find("JoinCode").GetComponent<TMPro.TMP_Text>().text = _gameClient.CurrentLobbyState.JoinCode;
|
||||
else if (_gameClient.CurrentLobbyState.Phase == GamePhase.Loading)
|
||||
{
|
||||
_CreateJoinLobby.enabled = false;
|
||||
_InLobby.enabled = false;
|
||||
_GameScreen.enabled = false;
|
||||
_LoadingScreen.enabled = true;
|
||||
return;
|
||||
}
|
||||
else if (_gameClient.CurrentLobbyState.Phase == GamePhase.Lobby)
|
||||
{
|
||||
_InLobby.enabled = true;
|
||||
_CreateJoinLobby.enabled = false;
|
||||
var playerList = _InLobby.transform.Find("PlayerList").GetComponent<TMPro.TMP_Text>();
|
||||
playerList.text = "";
|
||||
foreach (var player in _gameClient.CurrentLobbyState.Players)
|
||||
{
|
||||
playerList.text += player.DisplayName + "\n";
|
||||
}
|
||||
_InLobby.transform.Find("JoinCode").GetComponent<TMPro.TMP_Text>().text = _gameClient.CurrentLobbyState.JoinCode;
|
||||
return;
|
||||
}
|
||||
else if (_gameClient.CurrentLobbyState.Phase == GamePhase.Playing)
|
||||
{
|
||||
_CreateJoinLobby.enabled = false;
|
||||
_InLobby.enabled = false;
|
||||
_GameScreen.enabled = true;
|
||||
_LoadingScreen.enabled = false;
|
||||
_GameScreen.transform.Find("Role").GetComponent<TMPro.TMP_Text>().text = _gameClient.MyRole.ToString() ;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user