public InputAction GetAction(InputActionId actionId, InputActionContextId contextId) { InputAction action2; using (HashSet <InputAction> .Enumerator enumerator = this.nameToAction.GetValues(actionId.actionName).GetEnumerator()) { while (true) { if (enumerator.MoveNext()) { InputAction current = enumerator.Current; if (!current.contextId.Equals(contextId)) { continue; } action2 = current; } else { return(null); } break; } } return(action2); }
private void ChangeInputActionKey(InputActionId actionId, InputActionContextId contextId, int keyId, InputKeyCode newKeyCode) { foreach (InputAction action in this.nameToAction[actionId.actionName]) { if (Equals(action.contextId, contextId)) { KeyCode keyCode = (newKeyCode == null) ? KeyCode.None : newKeyCode.keyCode; this.RemoveKeysFromMap(action); this.SetActionKey(action, keyId, keyCode); this.AddKeysToMap(action); this.SaveKeys(action, keyId, keyCode); } } }
public override bool Equals(object obj) { InputActionContextId id = (InputActionContextId)obj; return(id.contextName.Equals(this.contextName) && id.contextTypeName.Equals(this.contextTypeName)); }
public void DeleteKeyBinding(InputActionId actionId, InputActionContextId contextId, int id) { this.ChangeInputActionKey(actionId, contextId, id, (InputKeyCode)null); }
public void ChangeInputActionKey(InputActionId actionId, InputActionContextId contextId, int keyId, KeyCode newKeyCode) { this.ChangeInputActionKey(actionId, contextId, keyId, new InputKeyCode(newKeyCode)); }