/// <summary> /// Tests whether the designated mouse button is the current button that is being /// used to generate the current event. Valid only within an Ngui UICamera-generated event. /// </summary> /// <param name="mouseButton">The mouse button.</param> /// <returns> /// <c>true</c> if the mouseButton is the one that was used to generate the current event; otherwise, <c>false</c>. /// </returns> public static bool IsMouseButton(NguiMouseButton mouseButton) { return mouseButton == CurrentMouseButton(); }
/// <summary> /// Detects whether any mouse button besides the one provided is being held down across multiple frames. /// </summary> /// <returns> /// <c>true</c> if any other mouse button is being held down; otherwise, <c>false</c>. /// </returns> public static bool IsAnyMouseButtonDownBesides(NguiMouseButton mouseButton) { foreach (NguiMouseButton button in Enums<NguiMouseButton>.GetValues().Except(NguiMouseButton.None)) { if (button != mouseButton) { if (IsMouseButtonDown(button)) { return true; } } } return false; }
public UnconsumedMouseButtonPress(NguiMouseButton button, bool isDown) { Button = button; IsDown = isDown; }
/// <summary> /// Detects whether a mouse button is being held down across multiple frames. /// </summary> /// <param name="mouseButton">The mouse button.</param> /// <returns> /// <c>true</c> if the mouse button is being held down; otherwise, <c>false</c>. /// </returns> public static bool IsMouseButtonDown(NguiMouseButton mouseButton) { return Input.GetMouseButton(mouseButton.ToUnityMouseButton()); }
public UnconsumedMouseButtonClick(NguiMouseButton button) { MouseButton = button; }