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; } } } }
public void ButtonPushed(ButtonKeyBinding button) { GetKeyBindings(); foreach (var b in buttonKeyBindings) { b.EnableButton(); } currentlyPushed = button; currentlyPushed.DisableButton(); }
public void ButtonPushed(ButtonKeyBinding button) { input.ButtonPushed(button); }