docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method TryGetCurrentUIRaycastResult

    TryGetCurrentUIRaycastResult(out RaycastResult)

    Gets the first UI ray cast result, if any ray cast results are available.

    Declaration
    public bool TryGetCurrentUIRaycastResult(out RaycastResult raycastResult)
    Parameters
    Type Name Description
    RaycastResult raycastResult

    When this method returns, contains the UI ray cast result if available; otherwise, the default value.

    Returns
    Type Description
    bool

    Returns true if a hit occurred, implying the ray cast hit information is valid. Otherwise, returns false.

    TryGetCurrentUIRaycastResult(out RaycastResult, out int)

    Gets the first UI ray cast result, if any ray cast results are available.

    Declaration
    public bool TryGetCurrentUIRaycastResult(out RaycastResult raycastResult, out int raycastEndpointIndex)
    Parameters
    Type Name Description
    RaycastResult raycastResult

    When this method returns, contains the UI ray cast result if available; otherwise, the default value.

    int raycastEndpointIndex

    When this method returns, contains the index of the sample endpoint if a hit occurred. Otherwise, a value of 0 if no hit occurred.

    Returns
    Type Description
    bool

    Returns true if a hit occurred, implying the ray cast hit information is valid. Otherwise, returns false.

    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)