This script checks for joystick and keyboard input. More...
Public Types | |
enum | KeyInputSwitchesModeTo { Keyboard , Mouse } |
Public Member Functions | |
delegate bool | GetButtonDownDelegate (string buttonName) |
delegate float | GetAxisDelegate (string axisName) |
void | Awake () |
void | OnDestroy () |
void | Start () |
void | SetInputDevice (InputDevice newDevice) |
void | Update () |
bool | IsUsingJoystick () |
bool | IsUsingMouse () |
void | BrieflyIgnoreMouseMovement () |
bool | IsUsingKeyboard () |
bool | IsBackButtonDown () |
void | SetCursor (bool visible) |
void | ForceCursor (bool visible) |
Static Public Member Functions | |
static bool | IsButtonDown (string buttonName) |
static bool | IsButtonUp (string buttonName) |
static bool | IsKeyDown (KeyCode keyCode) |
static bool | IsAnyKeyDown () |
static float | GetAxis (string axisName) |
static Vector3 | GetMousePosition () |
static bool | DefaultGetKeyDown (KeyCode keyCode) |
static bool | DefaultGetAnyKeyDown () |
static bool | DefaultGetButtonDown (string buttonName) |
static bool | DefaultGetButtonUp (string buttonName) |
static float | DefaultGetAxis (string axisName) |
static Vector3 | DefaultGetMousePosition () |
static bool | DefaultGetMouseButtonDown (int buttonNumber) |
Public Attributes | |
InputDevice | inputDevice = InputDevice.Joystick |
KeyCode[] | joystickKeyCodesToCheck = new KeyCode[] { KeyCode.JoystickButton0, KeyCode.JoystickButton1, KeyCode.JoystickButton2, KeyCode.JoystickButton7 } |
string[] | joystickButtonsToCheck = new string[0] |
string[] | joystickAxesToCheck = new string[0] |
float | joystickAxisThreshold = 0.5f |
string[] | keyButtonsToCheck = new string[0] |
KeyCode[] | keyCodesToCheck = new KeyCode[] { KeyCode.Escape } |
KeyInputSwitchesModeTo | keyInputSwitchesModeTo = KeyInputSwitchesModeTo.Mouse |
bool | alwaysAutoFocus = false |
bool | detectMouseControl = true |
float | mouseMoveThreshold = 0.1f |
bool | controlCursorState = true |
bool | enforceCursorOnPause = false |
bool | controlGraphicRaycasters = false |
KeyCode[] | backKeyCodes = new KeyCode[] { KeyCode.JoystickButton1 } |
string[] | backButtons = new string[] { "Cancel" } |
string | submitButton = "Submit" |
bool | singleton = true |
UnityEvent | onUseKeyboard = new UnityEvent() |
UnityEvent | onUseJoystick = new UnityEvent() |
UnityEvent | onUseMouse = new UnityEvent() |
UnityEvent | onUseTouch = new UnityEvent() |
GetButtonDownDelegate | GetButtonDown = null |
GetButtonDownDelegate | GetButtonUp = null |
GetAxisDelegate | GetInputAxis = null |
Properties | |
static InputDeviceManager | instance [get, set] |
static InputDevice | currentInputDevice [get] |
Current input device detected by InputDeviceManager. | |
static bool | deviceUsesCursor [get] |
Returns true if current input device uses mouse cursor. | |
static CursorLockMode | cursorLockMode [get, set] |
Lock mode to use when locking cursor. | |
static bool | autoFocus [get] |
Automatically select (and keep selected) a selectable on the current UIPanel. | |
static bool | isBackButtonDown [get] |
static bool | isInputAllowed [get, set] |
Allow user input? | |
This script checks for joystick and keyboard input.
If the player uses a joystick, it enables autofocus. If the player uses the mouse or keyboard, it disables autofocus.
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inlinestatic |
delegate float PixelCrushers.InputDeviceManager.GetAxisDelegate | ( | string | axisName | ) |
delegate bool PixelCrushers.InputDeviceManager.GetButtonDownDelegate | ( | string | buttonName | ) |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool PixelCrushers.InputDeviceManager.alwaysAutoFocus = false |
string [] PixelCrushers.InputDeviceManager.backButtons = new string[] { "Cancel" } |
KeyCode [] PixelCrushers.InputDeviceManager.backKeyCodes = new KeyCode[] { KeyCode.JoystickButton1 } |
bool PixelCrushers.InputDeviceManager.controlCursorState = true |
bool PixelCrushers.InputDeviceManager.controlGraphicRaycasters = false |
bool PixelCrushers.InputDeviceManager.detectMouseControl = true |
bool PixelCrushers.InputDeviceManager.enforceCursorOnPause = false |
GetButtonDownDelegate PixelCrushers.InputDeviceManager.GetButtonDown = null |
GetButtonDownDelegate PixelCrushers.InputDeviceManager.GetButtonUp = null |
GetAxisDelegate PixelCrushers.InputDeviceManager.GetInputAxis = null |
InputDevice PixelCrushers.InputDeviceManager.inputDevice = InputDevice.Joystick |
string [] PixelCrushers.InputDeviceManager.joystickAxesToCheck = new string[0] |
float PixelCrushers.InputDeviceManager.joystickAxisThreshold = 0.5f |
string [] PixelCrushers.InputDeviceManager.joystickButtonsToCheck = new string[0] |
KeyCode [] PixelCrushers.InputDeviceManager.joystickKeyCodesToCheck = new KeyCode[] { KeyCode.JoystickButton0, KeyCode.JoystickButton1, KeyCode.JoystickButton2, KeyCode.JoystickButton7 } |
string [] PixelCrushers.InputDeviceManager.keyButtonsToCheck = new string[0] |
KeyCode [] PixelCrushers.InputDeviceManager.keyCodesToCheck = new KeyCode[] { KeyCode.Escape } |
KeyInputSwitchesModeTo PixelCrushers.InputDeviceManager.keyInputSwitchesModeTo = KeyInputSwitchesModeTo.Mouse |
float PixelCrushers.InputDeviceManager.mouseMoveThreshold = 0.1f |
UnityEvent PixelCrushers.InputDeviceManager.onUseJoystick = new UnityEvent() |
UnityEvent PixelCrushers.InputDeviceManager.onUseKeyboard = new UnityEvent() |
UnityEvent PixelCrushers.InputDeviceManager.onUseMouse = new UnityEvent() |
UnityEvent PixelCrushers.InputDeviceManager.onUseTouch = new UnityEvent() |
bool PixelCrushers.InputDeviceManager.singleton = true |
string PixelCrushers.InputDeviceManager.submitButton = "Submit" |
|
staticget |
Automatically select (and keep selected) a selectable on the current UIPanel.
|
staticget |
Current input device detected by InputDeviceManager.
May changed based on input from other devices.
|
staticgetset |
Lock mode to use when locking cursor.
|
staticget |
Returns true if current input device uses mouse cursor.
|
staticgetset |
|
staticget |
|
staticgetset |
Allow user input?