/// <summary> /// Gets the label of a bind for the OnGUI buttons. /// </summary> /// <param name="bind">The bind that is being displayed.</param> /// <param name="listener">The listener label that corresponds to the button.</param> /// <returns></returns> private string GetBindingLabel(Binding bind, BindInputListener listener) { // if the key is being rekeybound to the tested listener key then return the waiting message if (currentRebind == bind && bind.ReKeybinding == listener) return "..."; // if the key does not have the listener that's being checked then return the "no keybind" message if(!bind.HasListener(listener)) return NoKeybindLabel; switch (listener) { case BindInputListener.MOUSE: return bind.MouseButton.ToString(); case BindInputListener.KEYBOARD: return bind.Key.ToString(); case BindInputListener.CONTROLLER: return bind.ControllerButton.ToString(); } return null; }