Ejemplo n.º 1
0
    public void PlayerButtonPressed()
    {
        GameManagerScript gameManager = FindObjectOfType <GameManagerScript>();

        Assert.IsNotNull <GameManagerScript>(gameManager);

        if (isLocalPlayer)
        {
            if (!gameManager.IsGameStarted())
            {
                ToggleReady();
            }
        }
        else
        {
            if (gameManager.IsGameStarted())
            {
                List <CaptainsMessPlayer> players = GetPlayers();
                foreach (CaptainsMessPlayer player in players)
                {
                    NetworkedPlayerScript nps = player.GetComponent <NetworkedPlayerScript>();
                    if (player.name == "LOCAL Player")
                    {
                        nps.CmdSetMatchSongID(songID, color);
                    }
                    nps.playerButton.SetActive(false);
                    nps.playerButton.GetComponent <Button>().interactable = false;
                }

                playerButton.SetActive(true);
                playerButton.GetComponent <Button>().interactable = false;
                playerButton.transform.DOLocalMove(new Vector3(30, 20, 0), fastMovementSpeed);
                playerButton.transform.DOScale(new Vector3(1.5f, 1.5f, 1f), fastMovementSpeed);

                playerParent.GetComponent <RectTransform>().sizeDelta = new Vector2(170, 140);

                GUIManagerScript.SetBackButton(true);
            }
        }
    }