Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        // need to configure input manager to reflect player joy number
        // modify cam script to take player joy number instead of player number

        for (int i = 0; i < nums.Count; i++)
        {
            string key = "joystick " + nums[i] + " button " + 0;
            if (Input.GetKeyDown(key))
            {
                string name = "player" + playerNum;
                PlayerPrefs.SetInt(name, nums[i]);
                nums.RemoveAt(i);
                buttons[playerNum - 1].gameObject.SetActive(false);
                AddPlayer(i);
                i = 0;
                //SoundManager.Instance.PlaySound(audioClips[]);
                break;
            }
        }
        if (PlayerPrefs.GetInt("player1") != 0)
        {
            if (Input.GetKey("joystick " + PlayerPrefs.GetInt("player1") + " button 7"))
            {
                LoadSceneManager lsm = GameObject.Find("start game").GetComponent <LoadSceneManager>();
                lsm.LoadSceneByButton("Main");
            }
        }
    }