Пример #1
0
 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);
 }
Пример #2
0
    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());
    }
Пример #3
0
    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;
                    }
                }
            }
        }
    }
Пример #4
0
 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();
 }
Пример #5
0
 private void Start()
 {
     text.spanishText = ClientSignedIn.spanishMsg;
     text.englishText = ClientSignedIn.englishMsg;
     text.UpdateLanguage();
 }