docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method OnGrab

    OnGrab(XRGrabInteractable)

    Called by Unity when the given Interactable is grabbed (in other words, when entering the Select state). This method won't be called again until the Interactable is released by every Interactor. Use this to do any code initialization based on the first Interactor that selects the Interactable.

    Declaration
    public virtual void OnGrab(XRGrabInteractable grabInteractable)
    Parameters
    Type Name Description
    XRGrabInteractable grabInteractable

    The XR Grab Interactable being grabbed.

    Implements
    IXRGrabTransformer.OnGrab(XRGrabInteractable)
    Remarks

    In other words, this will be called when the selection count changes from 0 to 1.

    See Also
    OnGrabCountChanged(XRGrabInteractable, Pose, Vector3)
    Grab()
    In This Article
    Back to top
    Copyright © 2023 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)