docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRReferenceImageLibrary

    A reference image library is a collection of images to search for in the physical environment when image tracking is enabled.

    Inheritance
    object
    Object
    ScriptableObject
    XRReferenceImageLibrary
    Implements
    IReferenceImageLibrary
    ISerializationCallbackReceiver
    IEnumerable<XRReferenceImage>
    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 = "ReferenceImageLibrary", menuName = "XR/Reference Image Library", order = 1001)]
    public class XRReferenceImageLibrary : ScriptableObject, IReferenceImageLibrary, ISerializationCallbackReceiver, IEnumerable<XRReferenceImage>, IEnumerable
    Remarks

    Image libraries are immutable at runtime. To create and manipulate an image library via Editor scripts, see the extension methods in UnityEditor.XR.ARSubsystems.XRReferenceImageLibraryExtensions. If you need to mutate the library at runtime, see MutableRuntimeReferenceImageLibrary.

    Properties

    this[int]

    Get an image by index.

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

    The index of the image in the library. Must be between 0 and count - 1.

    Property Value
    Type Description
    XRReferenceImage

    The XRReferenceImage at index.

    Exceptions
    Type Condition
    IndexOutOfRangeException

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

    count

    The number of images in the library.

    Declaration
    public int count { get; }
    Property Value
    Type Description
    int

    dataStore

    (Read Only) Binary data associated with a string key.

    Declaration
    public IReadOnlyDictionary<string, byte[]> dataStore { get; }
    Property Value
    Type Description
    IReadOnlyDictionary<string, byte[]>
    Remarks

    This is used by providers to associate provider-specific data with the library. During Player Build (in an IPreprocessBuildWithReport.OnPreprocessBuild callback), the data store is first cleared. Each enabled provider then has an opportunity to add one or more entries for itself.

    Providers can use this to store a serialized version of the image library specific to that provider. Set data with UnityEditor.XR.ARSubsystems.XRReferenceImageLibraryExtensions.SetDataForKey.

    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

    Methods

    GetEnumerator()

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

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

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

    Examples

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

    XRReferenceImageLibrary imageLibrary = ...
    foreach (var referenceImage in imageLibrary)
    {
        Debug.LogFormat("Image guid: {0}", referenceImage.guid);
    }

    indexOf(XRReferenceImage)

    Get the index of referenceImage in the image library.

    Declaration
    public int indexOf(XRReferenceImage referenceImage)
    Parameters
    Type Name Description
    XRReferenceImage referenceImage

    The XRReferenceImage to find.

    Returns
    Type Description
    int

    The zero-based index of the referenceImage, or -1 if not found.

    Implements

    IReferenceImageLibrary
    ISerializationCallbackReceiver
    IEnumerable<T>
    IEnumerable
    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)