// This is called if a binding is rejected while listening, usually due to the // rules set up in the listen options. It's unlikely to get called in this // example since we have UnsetDuplicateBindingsOnSet set to true. static void OnBindingRejected(PlayerAction action, BindingSource binding, BindingSourceRejectionType rejectionType) { // This isn't strictly necessary, but maybe we could do a brief flashing red // indicator or warning message to tell the user what's going on. We don't // actually need to stop listening either, but we do for this example. action.StopListeningForBinding(); }
public void CallOnBindingRejected(PlayerAction playerAction, BindingSource bindingSource, BindingSourceRejectionType bindingSourceRejectionType) { if (OnBindingRejected != null) { OnBindingRejected(playerAction, bindingSource, bindingSourceRejectionType); } }
private void OnBindingRejected(PlayerAction action, BindingSource binding, BindingSourceRejectionType reason) { Debug.Log("Binding rejected... " + binding.DeviceName + ": " + binding.Name + " " + reason); }