docs.unity3d.com
    Show / Hide Table of Contents

    Class XRReferenceObjectLibraryExtensions

    Editor extensions to the XRReferenceObjectLibrary.

    Inheritance
    Object
    XRReferenceObjectLibraryExtensions
    Namespace: UnityEditor.XR.ARSubsystems
    Syntax
    public static class XRReferenceObjectLibraryExtensions

    Methods

    Add(XRReferenceObjectLibrary)

    Creates a new XRReferenceObject and adds it to the library.

    Declaration
    public static int Add(this XRReferenceObjectLibrary library)
    Parameters
    Type Name Description
    XRReferenceObjectLibrary library

    The XRReferenceObjectLibrary being extended.

    Returns
    Type Description
    Int32

    The index in the library at which the new reference object was created.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if library is null.

    RemoveAt(XRReferenceObjectLibrary, Int32)

    Removes the XRReferenceObject at index.

    Declaration
    public static void RemoveAt(this XRReferenceObjectLibrary library, int index)
    Parameters
    Type Name Description
    XRReferenceObjectLibrary library

    The XRReferenceObjectLibrary being extended.

    Int32 index

    The index of the XRReferenceObject to remove.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if library is null.

    IndexOutOfRangeException

    Thrown if index is not between 0 and library.count - 1.

    SetReferenceObjectEntry(XRReferenceObjectLibrary, Int32, Type, XRReferenceObjectEntry)

    Sets the entry for the given type of the XRReferenceObject at index index.

    Declaration
    public static void SetReferenceObjectEntry(this XRReferenceObjectLibrary library, int index, Type type, XRReferenceObjectEntry entry)
    Parameters
    Type Name Description
    XRReferenceObjectLibrary library

    The XRReferenceObjectLibrary being extended.

    Int32 index

    The index of the XRReferenceObject to modify.

    Type type

    The type of the XRReferenceObjectEntry being set.

    XRReferenceObjectEntry entry

    The entry to use for the given type.

    Remarks

    Each reference object contains a list of "entries", one for each provider (implementation of XRObjectTrackingSubsystem). This method sets the entry for a given type, which is the data that will be used when that provider is active.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if library is null.

    ArgumentNullException

    Thrown if type is null.

    IndexOutOfRangeException

    Thrown if index is not between 0 and library.count - 1.

    ArgumentException

    Thrown if type does not derive from XRReferenceObjectEntry.

    SetReferenceObjectName(XRReferenceObjectLibrary, Int32, String)

    Sets the name of the XRReferenceObject at index.

    Declaration
    public static void SetReferenceObjectName(this XRReferenceObjectLibrary library, int index, string name)
    Parameters
    Type Name Description
    XRReferenceObjectLibrary library

    The XRReferenceObjectLibrary being extended.

    Int32 index

    The index of the XRReferenceObject to modify.

    String name

    The new name of the XRReferenceObject.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if library is null.

    IndexOutOfRangeException

    Thrown if index is not between 0 and library.count - 1.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023