public void UpdateVisuals(PlayerRoomInfo info) { if (info != null) { player = info.player; playerName.text = info.player; numPlayers.spanishText = "Jugadores: " + info.count + "/" + PlayerRoomInfo.maxPlayers; numPlayers.englishText = "Players: " + info.count + "/" + PlayerRoomInfo.maxPlayers; numPlayers.UpdateLanguage(); } gameObject.SetActive(info != null); }
private void Start() { if (Client.user != null) { errorPanel.SetActive(ClientInRoom.error >= 0); ClientInRoom.error = -1; welcomeText.spanishText = "¡Bienvenido/a " + Client.user.id + "!"; welcomeText.englishText = "Welcome " + Client.user.id + "!"; welcomeText.UpdateLanguage(); playerAvatar.SetUser(Client.user); playerAvatar.UpdateVisuals(); local = onlyPC.GetComponentInParent <Button>(); onlyPC.gameObject.SetActive(GameManager.isHandheld); local.interactable = !GameManager.isHandheld; } //ClientSignedIn.signedOutEvent += ()=> exitButton.onClick.AddListener(() => ClientSignedIn.TrySignOut()); }
private void OnTriggerEnter(Collider other) { if (other.gameObject.tag.Equals("Player")) { var userInfo = other.gameObject.GetComponent <PlayerAvatar>().userInfo; if (!GameManager.isLocalGame) { if (hostOnly && !(GameManager.isHost && userInfo.isHost)) { return; } if (requiresMoreThanOnePlayerInHub && ClientInRoom.players.Count <= 1) { return; } if (userInfo.id != Client.user.id) { return; } } else if (requiresMoreThanOnePlayerInHub && FindObjectOfType <PlayerSpawnerManager>().currentJoinedPlayers <= 1) { return; } Prompt prompt = other.gameObject.GetComponentInChildren <Prompt>(); promptTargets.Add(prompt); Button btn = PromptsManager.RequestPrompt(); if (btn != null) { btn.onClick.RemoveAllListeners(); btn.onClick.AddListener(() => onPressed.Invoke()); prompt.SetButton(btn); Bilingual b = prompt.btn.GetComponentInChildren <Bilingual>(); b.spanishText = spanishText; b.englishText = englishText; b.UpdateLanguage(); Image img = prompt.btn.GetComponentsInChildren <Image>()[1]; if (GameManager.isHandheld) { img.enabled = mobileSprite != null; if (mobileSprite != null) { img.sprite = mobileSprite; } } else { PlayerInput playerInput = other.GetComponent <PlayerInput>(); switch (playerInput.currentControlScheme) { case "Gamepad": img.enabled = gamepadSprite != null; img.sprite = gamepadSprite; break; case "Keyboard&Mouse": img.enabled = keyboardPlayer1Sprite != null; img.sprite = keyboardPlayer1Sprite; break; case "VirtualKeyboard": img.enabled = keyboardPlayer2Sprite != null; img.sprite = keyboardPlayer2Sprite; break; } } } } }
public void ShowNameRestrictions() { bilingualRestrictions.spanishText = "El nombre puede contener letras, números, guion y barra baja"; bilingualRestrictions.englishText = "The username can contain letters, numbers, hyphen and underscore"; bilingualRestrictions.UpdateLanguage(); }
private void Start() { text.spanishText = ClientSignedIn.spanishMsg; text.englishText = ClientSignedIn.englishMsg; text.UpdateLanguage(); }