PlayerGUI.cs 373 B

12345678910111213141516
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. namespace Mirror.Examples.MultipleMatch
  4. {
  5. public class PlayerGUI : MonoBehaviour
  6. {
  7. public Text playerName;
  8. public void SetPlayerInfo(PlayerInfo info)
  9. {
  10. playerName.text = "Player " + info.playerIndex;
  11. playerName.color = info.ready ? Color.green : Color.red;
  12. }
  13. }
  14. }