示例#1
0
    // Update is called once per frame
    void Update()
    {
        if (CONTROLLERATTRIBUTIONMANAGER_DEBUG && Input.GetKey(KeyCode.Space))
        {
            Destroy(GameObject.Find("MainMenuMusic"));
            SceneLoader.StaticLoadScene("Level1_Blender");
        }

        for (int i = 0; i < InputManager.Devices.Count; ++i)
        {
            if (InputManager.Devices[i].CommandIsPressed)
            {
                if (currentPlayerAttribution <= 2) // still mapping controllers
                {
                    if (!InputsManager.IsControllerIdUsed(i))
                    {
                        Debug.Log("setting controller number : " + i);
                        if (!InputsManager.playerInputsDictionary.ContainsKey(currentPlayerAttribution))
                        {
                            InputsManager.playerInputsDictionary[currentPlayerAttribution] = new InputTable();
                        }
                        InputsManager.playerInputsDictionary[currentPlayerAttribution].SetControllerId(i);
                        ++currentPlayerAttribution;
                        playersPressStartGO[currentPlayerAttribution - 1].SetActive(false);
                        if (currentPlayerAttribution <= 2)
                        {
                            playersPressStartGO[currentPlayerAttribution].SetActive(true);
                        }
                        playersStatusGO[currentPlayerAttribution - 1].SetActive(true);
                    }
                }
                else
                {
                    Destroy(GameObject.Find("MainMenuMusic"));
                    SceneLoader.StaticLoadScene("Level1_Blender");
                }
            }
        }
    }