예제 #1
0
    void Update()
    {
        if (settings.getIsPaused())
        {
            return;
        }

        if (Input.GetButtonDown(buttonsSet[0]))
        {
            if (Input.GetAxis(buttonsSet[0]) < 0)
            {
                if (index < characters.Length - 1)
                {
                    index++;
                    arrow.transform.position -= new Vector3(0, 50, 0);
                }
            }
            else if (Input.GetAxis(buttonsSet[0]) > 0)
            {
                if (index > 0)
                {
                    index--;
                    arrow.transform.position += new Vector3(0, 50, 0);
                }
            }

            gameSet.setBlackCharacter(index);
            Input.ResetInputAxes();
        }

        gameController.setBlackPicsAndDesc(index);
    }
예제 #2
0
    public void Choose()
    {
        if (whichPlayer == "white" && gameSet.getWhitePlays())
        {
            Destroy(GameObject.Find("whiteArrow"));
            GameObject arrow = Instantiate(arrowPrefab, new Vector3(transform.position.x - 20, transform.position.y, transform.position.z), new Quaternion(0, 0, 0, 0), transform);
            arrow.name = "whiteArrow";

            gameSet.setWhiteCharacter(index);
            gameController.setWhitePicsAndDesc(index);
        }
        else if (whichPlayer == "black" && gameSet.getBlackPlays())
        {
            Destroy(GameObject.Find("blackArrow"));
            GameObject arrow = Instantiate(arrowPrefab, new Vector3(transform.position.x + 20, transform.position.y, transform.position.z), new Quaternion(0, 90, 0, 0), transform);
            arrow.name = "blackArrow";

            gameSet.setBlackCharacter(index);
            gameController.setBlackPicsAndDesc(index);
        }
    }