CPlayerElement.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class CPlayerElement : MonoBehaviour
  6. {
  7. //For Room Information UI display
  8. public Text PlayerName; //PlayerName
  9. public Text IsReady; //standby state
  10. //For storing the roomname of the room entry button
  11. private string playername;
  12. //Function to set Room information from GetRoomList to RoomElement
  13. public void SetPlayerInfo(string _PlayerName, bool _IsReady)
  14. {
  15. //Obtain roomname for room entry button
  16. playername = _PlayerName;
  17. PlayerName.text = _PlayerName;
  18. if (_IsReady)
  19. {
  20. IsReady.text = LocalizeUtility.
  21. GetLocalizedString(
  22. EngMessage: "Ready",
  23. JpnMessage: "準備完了"
  24. );
  25. IsReady.color = new Color32(53, 255, 4, 255);
  26. }
  27. else
  28. {
  29. IsReady.text = LocalizeUtility.
  30. GetLocalizedString(
  31. EngMessage: "Not Ready",
  32. JpnMessage: "準備中"
  33. );
  34. IsReady.color = Color.red;
  35. }
  36. }
  37. }