コード例 #1
0
    // Update is called once per frame
    public new void Update()
    {
        if (menu.canInput)
        {
            foreach (menuButtons currentButton in m_menuButtons)
            {
                if (currentButton.usable)
                {
                    if (inputModule.GetButtonDown(currentButton.input))
                    {
                        currentButton.onButtonDown.Invoke();
                        //print ("Get " + currentButton.input + " down!");
                    }

                    if (inputModule.GetButtonUp(currentButton.input))
                    {
                        currentButton.onButtonUp.Invoke();
                    }

                    if (inputModule.GetNegativeButtonDown(currentButton.input))
                    {
                        currentButton.onNegativeButtonDown.Invoke();
                        //print ("Get " + currentButton.input + " down!");
                    }

                    if (inputModule.GetNegativeButtonUp(currentButton.input))
                    {
                        currentButton.onNegativeButtonUp.Invoke();
                    }
                }
                else if (inputModule.GetButtonDown(currentButton.input))
                {
                    currentButton.onButtonBlocked.Invoke();
                }
            }
        }

        //print("AxisGet " + inputModule.GetAxis ("Horizontal"));

        menu.inputAxes.x = inputModule.GetAxis("Horizontal");
        menu.inputAxes.y = inputModule.GetAxis("Vertical");

        menu.inputSubmit = inputModule.GetButtonDown("Menu Confirm");
        menu.inputCancel = inputModule.GetButtonDown("Menu Cancel");
    }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        foreach (menuButtons currentButton in m_menuButtons)
        {
            if (currentButton.usable)
            {
                if (inputModule.GetButtonDown(currentButton.input))
                {
                    currentButton.onButtonDown.Invoke();
                    print("Get " + currentButton.input + " down!");
                }

                if (inputModule.GetButtonUp(currentButton.input))
                {
                    currentButton.onButtonUp.Invoke();
                }
            }
            else if (inputModule.GetButtonDown(currentButton.input))
            {
                currentButton.onButtonBlocked.Invoke();
            }
        }
    }