TheKingsRace/Assets/Scripts/UI/Lobby/LobbyPlayerCard.cs
Julia Butenhoff db5b10ef47 Rewrote Networking and Base Lobby Created
- Rewrote networking based on tutorials from MLAPI Demo Project and
  Dapper Dino
- Created Lobby UI based on the turorial from Dapper Dino
- Linked Existing UI into using the new networking
- Modified Lobby Settings to only allow 3 players
- Added Field for players to enter their player name
2021-10-15 16:01:18 -05:00

32 lines
887 B
C#

using System;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class LobbyPlayerCard : MonoBehaviour {
[Header("Panels")]
[SerializeField] private GameObject waitingForPlayerPanel;
[SerializeField] private GameObject playerDataPanel;
[Header("Data Display")]
[SerializeField] private TMP_Text playerDisplayNameText;
[SerializeField] private Image selectedCharacterImage;
[SerializeField] private Toggle isReadyToggle;
public void UpdateDisplay(LobbyPlayerState lobbyPlayerState)
{
playerDisplayNameText.text = lobbyPlayerState.PlayerName;
isReadyToggle.isOn = lobbyPlayerState.IsReady;
waitingForPlayerPanel.SetActive(false);
playerDataPanel.SetActive(true);
}
public void DisableDisplay()
{
waitingForPlayerPanel.SetActive(true);
playerDataPanel.SetActive(false);
}
}