PixelCrushers.InputDeviceManager Class Reference

This script checks for joystick and keyboard input. More...

Inheritance diagram for PixelCrushers.InputDeviceManager:
Collaboration diagram for PixelCrushers.InputDeviceManager:

Public Member Functions

delegate bool GetButtonDownDelegate (string buttonName)
 
delegate float GetAxisDelegate (string axisName)
 
void Awake ()
 
void Start ()
 
void SetInputDevice (InputDevice newDevice)
 
void Update ()
 
bool IsUsingJoystick ()
 
bool IsUsingMouse ()
 
void BrieflyIgnoreMouseMovement ()
 
bool IsUsingKeyboard ()
 
bool IsBackButtonDown ()
 
bool DefaultGetButtonDown (string buttonName)
 
float DefaultGetAxis (string axisName)
 
void SetCursor (bool visible)
 

Static Public Member Functions

static bool IsButtonDown (string buttonName)
 
static float GetAxis (string axisName)
 

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 }
 
bool alwaysAutoFocus = false
 
bool detectMouseControl = true
 
float mouseMoveThreshold = 0.1f
 
bool controlCursorState = true
 
bool enforceCursorOnPause = false
 
bool controlGraphicRaycasters = true
 
KeyCode[] backKeyCodes = new KeyCode[] { KeyCode.JoystickButton1 }
 
string[] backButtons = new string[] { "Cancel" }
 
bool singleton = true
 
UnityEvent onUseKeyboard = new UnityEvent()
 
UnityEvent onUseJoystick = new UnityEvent()
 
UnityEvent onUseMouse = new UnityEvent()
 
UnityEvent onUseTouch = new UnityEvent()
 
GetButtonDownDelegate GetButtonDown = null
 
GetAxisDelegate GetInputAxis = null
 

Properties

static InputDeviceManager instance [get, set]
 
static InputDevice currentInputDevice [get]
 
static bool deviceUsesCursor [get]
 
static bool autoFocus [get]
 
static bool isBackButtonDown [get]
 

Detailed Description

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.

Member Function Documentation

void PixelCrushers.InputDeviceManager.Awake ( )
void PixelCrushers.InputDeviceManager.BrieflyIgnoreMouseMovement ( )
float PixelCrushers.InputDeviceManager.DefaultGetAxis ( string  axisName)
bool PixelCrushers.InputDeviceManager.DefaultGetButtonDown ( string  buttonName)
static float PixelCrushers.InputDeviceManager.GetAxis ( string  axisName)
static
delegate float PixelCrushers.InputDeviceManager.GetAxisDelegate ( string  axisName)
delegate bool PixelCrushers.InputDeviceManager.GetButtonDownDelegate ( string  buttonName)
bool PixelCrushers.InputDeviceManager.IsBackButtonDown ( )
static bool PixelCrushers.InputDeviceManager.IsButtonDown ( string  buttonName)
static
bool PixelCrushers.InputDeviceManager.IsUsingJoystick ( )
bool PixelCrushers.InputDeviceManager.IsUsingKeyboard ( )
bool PixelCrushers.InputDeviceManager.IsUsingMouse ( )
void PixelCrushers.InputDeviceManager.SetCursor ( bool  visible)
void PixelCrushers.InputDeviceManager.SetInputDevice ( InputDevice  newDevice)
void PixelCrushers.InputDeviceManager.Start ( )
void PixelCrushers.InputDeviceManager.Update ( )

Member Data Documentation

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 = true
bool PixelCrushers.InputDeviceManager.detectMouseControl = true
bool PixelCrushers.InputDeviceManager.enforceCursorOnPause = false
GetButtonDownDelegate PixelCrushers.InputDeviceManager.GetButtonDown = 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 }
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

Property Documentation

bool PixelCrushers.InputDeviceManager.autoFocus
staticget
InputDevice PixelCrushers.InputDeviceManager.currentInputDevice
staticget
bool PixelCrushers.InputDeviceManager.deviceUsesCursor
staticget
InputDeviceManager PixelCrushers.InputDeviceManager.instance
staticgetset
bool PixelCrushers.InputDeviceManager.isBackButtonDown
staticget

The documentation for this class was generated from the following file: