Added Lobbies
This commit is contained in:
35
Assets/GameManager/GameManager_UI.cs
Normal file
35
Assets/GameManager/GameManager_UI.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using UnityEngine;
|
||||
using Subsystems;
|
||||
using GeoSus.Client;
|
||||
using System.ComponentModel;
|
||||
|
||||
|
||||
namespace Subsystems
|
||||
{
|
||||
public class GameManager_UI
|
||||
{
|
||||
private GameClient _gameClient;
|
||||
private Canvas _CreateJoinLobby;
|
||||
private Canvas _InLobby;
|
||||
public GameManager_UI(GameClient gameClient, Canvas CreateJoinLobby, Canvas InLobby)
|
||||
{
|
||||
_gameClient = gameClient;
|
||||
_CreateJoinLobby = CreateJoinLobby;
|
||||
_InLobby = InLobby;
|
||||
_CreateJoinLobby.enabled = true;
|
||||
_InLobby.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)
|
||||
{
|
||||
playerList.text += player.DisplayName + "\n";
|
||||
}
|
||||
_InLobby.transform.Find("JoinCode").GetComponent<TMPro.TMP_Text>().text = _gameClient.CurrentLobbyState.JoinCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user