docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method GetWeightedScore

    GetWeightedScore(IXRInteractor, IXRInteractable)

    The filter calls this method to get a value that represents the intention to select the given target Interactable. Gets the weighted interaction score, the y-axis value in the weight curve for an x-axis value returned by CalculateNormalizedScore(IXRInteractor, IXRInteractable).

    Declaration
    public float GetWeightedScore(IXRInteractor interactor, IXRInteractable target)
    Parameters
    Type Name Description
    IXRInteractor interactor

    The Interactor whose Interactable targets (candidates) are being evaluated.

    IXRInteractable target

    The Interactable to evaluate the weighted score.

    Returns
    Type Description
    float

    Returns the weighted interaction score of the given target. Usually a normalized value but it can be negative and more than 1.
    You can configure the returned value of this method by editing the weight curve in the Inspector.
    Returns 1 if the intention is to select the given target.
    Returns 0 if the intention is to not select the given target. This will stop the evaluation process for the given target.
    Returns a negative value to exclude the given target from the list of targets for interaction.

    See Also
    XRTargetFilter
    GetValidTargets(List<IXRInteractable>)
    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)