docs.unity3d.com
    Show / Hide Table of Contents

    Struct MouseButtonModel

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

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: UnityEngine.XR.Interaction.Toolkit.UI
    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 UnityEngine.XR.Interaction.Toolkit.UI.MouseButtonModel.lastFrameDelta.

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

    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 Unity UI (UGUI) 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 Unity UI (UGUI) 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()
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023