docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Class XRLastSelectedEvaluator

    The last selected target Interactable will receive the highest normalized score. In the moment that an Interactable is selected by any of the linked Interactors, it'll have the highest normalized score of 1. Its normalized score will linearly decrease with time until the score reaches 0 after maxTime seconds.

    Inheritance
    object
    XRTargetEvaluator
    XRLastSelectedEvaluator
    Implements
    IDisposable
    IXRTargetEvaluatorLinkable
    Inherited Members
    XRTargetEvaluator.filter
    XRTargetEvaluator.enabled
    XRTargetEvaluator.weight
    XRTargetEvaluator.disposed
    XRTargetEvaluator.Awake()
    XRTargetEvaluator.OnDispose()
    XRTargetEvaluator.OnEnable()
    XRTargetEvaluator.Reset()
    XRTargetEvaluator.GetWeightedScore(IXRInteractor, IXRInteractable)
    XRTargetEvaluator.Dispose()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: UnityEngine.XR.Interaction.Toolkit.Filtering
    Assembly: solution.dll
    Syntax
    [Serializable]
    public class XRLastSelectedEvaluator : XRTargetEvaluator, IDisposable, IXRTargetEvaluatorLinkable

    Properties

    Name Description
    maxTime

    Any Interactable which was last selected over Max Time seconds ago will receive a normalized score of 0.

    Methods

    Name Description
    CalculateNormalizedScore(IXRInteractor, IXRInteractable)

    Calculates and returns a normalized value that represents the intention to select the given target Interactable.
    The highest score of 1 represents the intention to select the given target and the lowest score of 0 the intention to not select it, any value in between is valid.

    OnDisable()

    Unity calls this automatically when the evaluator becomes disabled. Use this method for any code cleanup. This is also called when the evaluator is disposed or when its filter is destroyed or disabled.

    OnLink(IXRInteractor)

    Called by the Target Filter when it links to the given Interactor. This is also called after the evaluator's Awake() for each already linked Interactor.
    Use this only for code initialization for the given Interactor.

    OnUnlink(IXRInteractor)

    Called by the Target Filter when it unlinks from the given Interactor. This is also called before the evaluator's OnDispose() for each linked Interactor.
    Use this for any code cleanup for the given Interactor.

    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)