docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method TryAddLoader

    TryAddLoader(XRLoader, int)

    Attempts to append the given loader to the list of loaders at the given index.

    Declaration
    public bool TryAddLoader(XRLoader loader, int index = -1)
    Parameters
    Type Name Description
    XRLoader loader

    The XRLoader to be added to this manager's instance of loaders.

    int index

    The index at which the given XRLoader should be added. If you set a negative or otherwise invalid index, the loader will be appended to the end of the list.

    Returns
    Type Description
    bool

    true if the loader is not a duplicate and was added to the list successfully, false otherwise.

    Remarks

    This method behaves differently in the Editor and during runtime/Play mode. While your app runs in the Editor and not in Play mode, attempting to add an XRLoader will always succeed and register that loader's type internally. Attempting to add a loader during runtime/Play mode will trigger a check to see whether a loader of that type was registered. If the check is successful, the loader is added. If not, the loader is not added and the method returns false.

    In This Article
    Back to top
    Copyright © 2024 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)