docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method OnLink

    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.

    Declaration
    public virtual void OnLink(IXRInteractor interactor)
    Parameters
    Type Name Description
    IXRInteractor interactor

    The Interactor being linked to the filter.

    Implements
    IXRTargetEvaluatorLinkable.OnLink(IXRInteractor)
    Remarks

    This is called even if the evaluator is disabled. You can check if the evaluator is enabled using the enabled property.
    You should not update the linked interactor list or the evaluator list in the filter, nor should you disable or enable evaluators. This can lead to out-of-order calls to OnLink(IXRInteractor) and OnUnlink(IXRInteractor).

    See Also
    OnUnlink(IXRInteractor)
    Link(IXRInteractor)
    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)