mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-05-26 14:30:31 -05:00
- 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
32 lines
887 B
C#
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);
|
|
}
|
|
}
|