private void ReadInputBinding_V2(InputAction action, XmlNode node) { InputBinding binding = action.CreateNewBinding(); foreach (XmlNode child in node.ChildNodes) { switch (child.LocalName) { case "Positive": binding.Positive = StringToKey(child.InnerText); break; case "Negative": binding.Negative = StringToKey(child.InnerText); break; case "DeadZone": binding.DeadZone = ReadAsFloat(child); break; case "Gravity": binding.Gravity = ReadAsFloat(child, 1.0f); break; case "Sensitivity": binding.Sensitivity = ReadAsFloat(child, 1.0f); break; case "Snap": binding.SnapWhenReadAsAxis = ReadAsBool(child); break; case "Invert": binding.InvertWhenReadAsAxis = ReadAsBool(child); break; case "UseNeg": binding.useNegativeAxisForButton = ReadAsBool(child); break; case "Rebindable": binding.rebindable = ReadAsBool(child); break; case "SensitivityEditable": binding.sensitivityEditable = ReadAsBool(child); break; case "InvertEditable": binding.invertEditable = ReadAsBool(child); break; case "Type": binding.Type = StringToInputType(child.InnerText); break; case "Axis": binding.MouseAxis = ReadAsInt(child); break; case "GamepadButton": binding.GamepadButton = StringToGamepadButton(child.InnerText); break; case "GamepadAxis": binding.GamepadAxis = StringToGamepadAxis(child.InnerText); break; } } }
static bool ButtonUpQuery(InputAction action, int playerID) { return(action.GetButtonUp(playerID)); }
static float RawAxisQuery(InputAction action, int playerID) { return(action.GetAxisRaw(playerID)); }
static float NormalAxisQuery(InputAction action, int playerID) { return(action.GetAxis(playerID)); }
public void DeleteAction(InputAction action) { m_actions.Remove(action); }