コード例 #1
0
    void Update()
    {
        if (gameManager.GetStart())
        {
            if (Input.GetButtonDown("Fire" + id))
            {
                int fireNum = uiManager.SetFire(stageId);
                if (fireNum != -1)
                {
                    GameObject ball = Instantiate(ballObjects[fireNum], shotPos.position, transform.rotation) as GameObject;
                    ball.transform.parent = transform.parent;
                }
            }

            /*
             * if (Input.GetButtonDown("Select" + id))
             * {
             *  uiManager.RotateAngle(1);
             * }
             *
             * if (Input.GetButtonDown("Select_Rev" + id))
             * {
             *  uiManager.RotateAngle(-1);
             * }
             */
        }
        else
        {
            if (Input.GetButtonDown("Fire" + id))
            {
                gameManager.SetPlayer(id);
                audioSource.PlayOneShot(clips[1]);
            }

            if (Input.GetButtonDown("Select" + id))
            {
                stageId = fieldSelector.SetStage(1);
                audioSource.PlayOneShot(clips[0]);
            }

            if (Input.GetButtonDown("Select_Rev" + id))
            {
                stageId = fieldSelector.SetStage(-1);
                audioSource.PlayOneShot(clips[0]);
            }
        }
    }