Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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);
         }
     }
 }
Exemplo n.º 3
0
 public void DeleteKeyBinding(InputActionId actionId, InputActionContextId contextId, int id)
 {
     this.ChangeInputActionKey(actionId, contextId, id, (InputKeyCode)null);
 }
Exemplo n.º 4
0
 public void ChangeInputActionKey(InputActionId actionId, InputActionContextId contextId, int keyId, KeyCode newKeyCode)
 {
     this.ChangeInputActionKey(actionId, contextId, keyId, new InputKeyCode(newKeyCode));
 }