Definition at line 47 of file Input.cs.
bool Hydrogen.Peripherals.Input.AddAction |
( |
String |
name, |
|
|
InputAction |
action |
|
) |
| |
Definition at line 67 of file Input.cs.
69 if (!_actions.ContainsKey (name)) {
70 _actions.Add (name, action);
bool Hydrogen.Peripherals.Input.AddControl |
( |
String |
controlName, |
|
|
String |
actionName |
|
) |
| |
Definition at line 99 of file Input.cs.
103 if (!_actions.TryGetValue (actionName, out action)) {
108 InputControlBase control = InputControlBase.CreateControl (controlName, action);
109 control.ActionName = actionName;
111 if (control != null) {
112 _controls.Add (control);
delegate void InputAction(InputEvent evt, float value, float time)
virtual void Hydrogen.Peripherals.Input.Awake |
( |
| ) |
|
|
protectedvirtual |
Reimplemented in hInput.
Definition at line 52 of file Input.cs.
54 if (_controls == null)
55 _controls =
new List<InputControlBase> ();
57 _actions =
new Dictionary<String, InputAction> ();
void Hydrogen.Peripherals.Input.ClearControls |
( |
| ) |
|
Clears all controls.
Definition at line 136 of file Input.cs.
List<KeyValuePair<string, string> > Hydrogen.Peripherals.Input.GetControls |
( |
| ) |
|
Gets the controls.
- Returns
- The controls as a ist<KeyValuePair<string, string>>
Definition at line 145 of file Input.cs.
147 var controlList =
new List<KeyValuePair<string, string>> ();
149 for (
int x = 0; x < _controls.Count; x++) {
150 controlList.Add (
new KeyValuePair<string, string> (_controls [x].ActionName, _controls [x].Name));
bool Hydrogen.Peripherals.Input.RemoveAction |
( |
String |
name, |
|
|
bool |
alsoRemoveControls |
|
) |
| |
Definition at line 76 of file Input.cs.
79 if (_actions.TryGetValue (name, out action)) {
80 if (alsoRemoveControls) {
84 foreach (InputControlBase control
in _controls) {
85 if (control.Action == action) {
86 _controls.Remove (control);
93 _actions.Remove (name);
delegate void InputAction(InputEvent evt, float value, float time)
void Hydrogen.Peripherals.Input.RemoveControl |
( |
String |
controlName | ) |
|
Definition at line 118 of file Input.cs.
123 foreach (InputControlBase control
in _controls) {
124 if (control.Name == controlName) {
125 _controls.Remove (control);
bool Hydrogen.Peripherals.Input.SetControls |
( |
List< KeyValuePair< string, string >> |
controlScheme | ) |
|
Set the controls from a List<KeyValuePair<string, string>>
This is useful for loading saved settings, specifically using Hydrogen.Serialization.INI
- Returns
true
, if controls were set, false
otherwise.
- Parameters
-
controlScheme | Control Scheme. |
Definition at line 164 of file Input.cs.
168 for (
int x = 0; x < controlScheme.Count; x++) {
170 check &=
AddControl (controlScheme [x].Value, controlScheme [x].Key);
virtual void Hydrogen.Peripherals.Input.Update |
( |
| ) |
|
|
protectedvirtual |
Definition at line 60 of file Input.cs.
62 foreach (InputControlBase control
in _controls) {