public AddBindingSyntax CombinedWith(string binding, string modifiers = null, string group = null) { if (action.m_BindingsCount - 1 != m_BindingIndex) { throw new InvalidOperationException("Must not add other bindings in-between calling AddBindings() and CombinedWith()"); } var result = action.AddBinding(binding, modifiers: modifiers, groups: group); action.m_Bindings[action.m_BindingsStartIndex + result.m_BindingIndex].flags |= InputBinding.Flags.ThisAndPreviousCombine; return(result); }
public InputAction AddAction(string name, string binding = null, string modifiers = null, string groups = null) { if (string.IsNullOrEmpty(name)) { throw new ArgumentException("Action must have name", "name"); } if (TryGetAction(name) != null) { throw new InvalidOperationException( string.Format("Cannot add action with duplicate name '{0}' to set '{1}'", name, this.name)); } var action = new InputAction(name); ArrayHelpers.Append(ref m_Actions, action); action.m_ActionSet = this; if (!string.IsNullOrEmpty(binding)) { action.AddBinding(binding, modifiers: modifiers, groups: groups); } return(action); }