invitedPlayersTextScript.cs 874 B

1234567891011121314151617181920212223242526272829
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class invitedPlayersTextScript : MonoBehaviour {
  6. public Button inviteButton;
  7. public GameObject InvitePanel;
  8. private Text invitedPlayersText;
  9. // Start is called before the first frame update
  10. void Start() {
  11. inviteButton.onClick.AddListener(OpenInvitePlayersDialog);
  12. invitedPlayersText = GetComponent<Text>();
  13. invitedPlayersText.text = 1 + " " + LocalizationManager.Instance.GetText("INVITED_PLAYERS_TEXT");
  14. }
  15. // Update is called once per frame
  16. void Update() {
  17. }
  18. public void updateText(int count) {
  19. invitedPlayersText.text = count + " " + LocalizationManager.Instance.GetText("INVITED_PLAYERS_TEXT");
  20. }
  21. void OpenInvitePlayersDialog() {
  22. InvitePanel.SetActive(true);
  23. }
  24. }