예제 #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);
        }
예제 #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);
         }
     }
 }
예제 #3
0
        public override bool Equals(object obj)
        {
            InputActionContextId id = (InputActionContextId)obj;

            return(id.contextName.Equals(this.contextName) && id.contextTypeName.Equals(this.contextTypeName));
        }
예제 #4
0
 public void DeleteKeyBinding(InputActionId actionId, InputActionContextId contextId, int id)
 {
     this.ChangeInputActionKey(actionId, contextId, id, (InputKeyCode)null);
 }
예제 #5
0
 public void ChangeInputActionKey(InputActionId actionId, InputActionContextId contextId, int keyId, KeyCode newKeyCode)
 {
     this.ChangeInputActionKey(actionId, contextId, keyId, new InputKeyCode(newKeyCode));
 }