docs.unity.cn
    Show / Hide Table of Contents

    Class XRRayInteractor.RaycastHitComparer

    Compares raycast hits by distance, to sort in ascending order.

    Inheritance
    Object
    XRRayInteractor.RaycastHitComparer
    Namespace: UnityEngine.XR.Interaction.Toolkit
    Syntax
    protected sealed class RaycastHitComparer : IComparer<RaycastHit>

    Methods

    Compare(RaycastHit, RaycastHit)

    Compares raycast hits by distance in ascending order.

    Declaration
    public int Compare(RaycastHit a, RaycastHit b)
    Parameters
    Type Name Description
    RaycastHit a

    The first raycast hit to compare.

    RaycastHit b

    The second raycast hit to compare.

    Returns
    Type Description
    Int32

    Returns less than 0 if a is closer than b. 0 if a and b are equal. Greater than 0 if b is closer than a.

    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on Wednesday, October 27, 2021