docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRReferenceObjectLibrary

    A container for reference objects. A reference object represents a 3D scan of a real object that can be recognized in the environment. A XRObjectTrackingSubsystem will search for objects based on the contents of a XRReferenceObjectLibrary.

    Inheritance
    object
    Object
    ScriptableObject
    XRReferenceObjectLibrary
    Implements
    IEnumerable<XRReferenceObject>
    IEnumerable
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: Unity.XR.ARSubsystems.dll
    Syntax
    [CreateAssetMenu(fileName = "ReferenceObjectLibrary", menuName = "XR/Reference Object Library", order = 3)]
    public class XRReferenceObjectLibrary : ScriptableObject, IEnumerable<XRReferenceObject>, IEnumerable

    Properties

    this[int]

    Get a reference object by index.

    Declaration
    public XRReferenceObject this[int index] { get; }
    Parameters
    Type Name Description
    int index

    The index in the array of reference objects. Must be greater than or equal to 0 and less than count.

    Property Value
    Type Description
    XRReferenceObject

    The XRReferenceObject at index.

    See Also
    XRReferenceObject
    XRReferenceObjectEntry

    count

    The number of reference objects in the library.

    Declaration
    public int count { get; }
    Property Value
    Type Description
    int
    See Also
    XRReferenceObject
    XRReferenceObjectEntry

    guid

    A GUID associated with this reference library. The GUID is used to uniquely identify this library at runtime.

    Declaration
    public Guid guid { get; }
    Property Value
    Type Description
    Guid
    See Also
    XRReferenceObject
    XRReferenceObjectEntry

    Methods

    Add(XRReferenceObject)

    Adds a new XRReferenceObject to this library.

    Declaration
    public void Add(XRReferenceObject referenceObject)
    Parameters
    Type Name Description
    XRReferenceObject referenceObject

    The reference object to add.

    See Also
    XRReferenceObject
    XRReferenceObjectEntry

    GetEnumerator()

    Gets an enumerator which can be used to iterate over the reference objects in this library.

    Declaration
    public List<XRReferenceObject>.Enumerator GetEnumerator()
    Returns
    Type Description
    List<XRReferenceObject>.Enumerator

    Returns an enumerator which can be used to iterate over the reference objects in this library.

    Examples

    This examples iterates over the reference objects contained in the library.

    XRReferenceObjectLibrary library = ...
    foreach (var referenceObject in library)
    {
        Debug.LogFormat("Reference object guid: {0}", referenceObject.guid);
    }
    See Also
    XRReferenceObject
    XRReferenceObjectEntry

    IndexOf(XRReferenceObject)

    Get the index of referenceObject in the object library.

    Declaration
    public int IndexOf(XRReferenceObject referenceObject)
    Parameters
    Type Name Description
    XRReferenceObject referenceObject

    The XRReferenceObject to find.

    Returns
    Type Description
    int

    Returns the zero-based index of the referenceObject if found. Returns -1 if not found.

    See Also
    XRReferenceObject
    XRReferenceObjectEntry

    Implements

    IEnumerable<T>
    IEnumerable

    See Also

    XRReferenceObject
    XRReferenceObjectEntry
    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)