PlayerGUI.cs 398 B

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