docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct MouseButtonModel

    Represents the state of a single mouse button within the uGUI (Unity UI) system. Keeps track of various book-keeping regarding clicks, drags, and presses. Can be converted to and from PointerEventData for sending into uGUI (Unity UI).

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.Interaction.Toolkit.UI
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    public struct MouseButtonModel

    Properties

    isDown

    Used to store the current binary state of the button. When set, will also track the changes between calls of OnFrameFinished() in lastFrameDelta.

    Declaration
    public bool isDown { get; set; }
    Property Value
    Type Description
    bool

    Methods

    CopyFrom(PointerEventData)

    Fills this object with the values from a PointerEventData.

    Declaration
    public void CopyFrom(PointerEventData eventData)
    Parameters
    Type Name Description
    PointerEventData eventData

    These objects are used to send data through the uGUI (Unity UI) system.

    CopyTo(PointerEventData)

    Fills a PointerEventData with this mouse button's internally cached values.

    Declaration
    public void CopyTo(PointerEventData eventData)
    Parameters
    Type Name Description
    PointerEventData eventData

    These objects are used to send data through the uGUI (Unity UI) system.

    OnFrameFinished()

    Call this on each frame in order to reset properties that detect whether or not a certain condition was met this frame.

    Declaration
    public void OnFrameFinished()

    Reset()

    Resets this object to it's default, unused state.

    Declaration
    public void Reset()
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)