Hydrogen Framework  1.3.1
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Hydrogen.Peripherals.InputAxisControl Class Reference
+ Inheritance diagram for Hydrogen.Peripherals.InputAxisControl:

Public Member Functions

 InputAxisControl (string name, string axis, InputAction action)
 
override void Capture ()
 

Additional Inherited Members

- Public Types inherited from Hydrogen.Peripherals.InputControlBase
enum  ControlType { ControlType.KeyboardButton, ControlType.MouseButton, ControlType.Axis, ControlType.DeltaAxis }
 
- Static Public Member Functions inherited from Hydrogen.Peripherals.InputControlBase
static InputControlBase CreateControl (String name, InputAction action)
 
- Static Public Attributes inherited from Hydrogen.Peripherals.InputControlBase
static readonly Dictionary
< String, String > 
DeltaAxes
 
static readonly Dictionary
< String, String > 
Axes
 
static readonly Dictionary
< String, int > 
MouseButtons
 
static readonly Dictionary
< String, KeyCode > 
KeyboardButtons
 
- Protected Member Functions inherited from Hydrogen.Peripherals.InputControlBase
 InputControlBase (String name, InputAction action)
 
- Properties inherited from Hydrogen.Peripherals.InputControlBase
string Name [get, set]
 
string ActionName [get, set]
 
InputAction Action [get, set]
 

Detailed Description

Definition at line 32 of file InputAxisControl.cs.

Constructor & Destructor Documentation

Hydrogen.Peripherals.InputAxisControl.InputAxisControl ( string  name,
string  axis,
InputAction  action 
)

Definition at line 36 of file InputAxisControl.cs.

37  : base (name, action)
38  {
39  _axis = axis;
40  }

Member Function Documentation

override void Hydrogen.Peripherals.InputAxisControl.Capture ( )
virtual

Implements Hydrogen.Peripherals.InputControlBase.

Definition at line 42 of file InputAxisControl.cs.

43  {
44  float value = UnityEngine.Input.GetAxis (_axis);
45  if (!UnityEngine.Mathf.Approximately (value, 0.0f)) {
46  Action (InputEvent.ValueSet, value, 0.0f);
47  }
48  }