コード例 #1
0
ファイル: InputManager.cs プロジェクト: play3577/SM64HDR
    void OnGUI()
    {
        if (currentlyPushed)
        {
            if (Event.current.type == EventType.KeyDown && Event.current.keyCode != KeyCode.Escape)
            {
                CustomInput.SetKey(Event.current.keyCode, currentlyPushed.Index);
                UpdateButtonStrings();
                currentlyPushed = null;
            }

            for (int joyK = 350; joyK < 409; joyK++)
            {
                // check for all joystick buttons
                if (Input.GetKey((KeyCode)joyK) && Event.current.keyCode != KeyCode.Escape)
                {
                    CustomInput.SetKey((KeyCode)joyK, currentlyPushed.Index);
                    UpdateButtonStrings();
                    currentlyPushed = null;
                }
            }

            foreach (string joyStick in JoySticks)
            {
                if (Input.GetAxis(joyStick) > 0.8f && Event.current.keyCode != KeyCode.Escape)
                {
                    CustomInput.SetAxis(joyStick, currentlyPushed.Index);
                    UpdateButtonStrings();
                    currentlyPushed = null;
                }
            }
        }
    }
コード例 #2
0
ファイル: InputManager.cs プロジェクト: play3577/SM64HDR
    public void ButtonPushed(ButtonKeyBinding button)
    {
        GetKeyBindings();

        foreach (var b in buttonKeyBindings)
        {
            b.EnableButton();
        }

        currentlyPushed = button;
        currentlyPushed.DisableButton();
    }
コード例 #3
0
 public void ButtonPushed(ButtonKeyBinding button)
 {
     input.ButtonPushed(button);
 }