docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ARTrackedImageManager

    A manager for ARTrackedImages. Uses the XRImageTrackingSubsystem to recognize and track 2D images in the physical environment.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    SubsystemLifecycleManager<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>
    ARTrackableManager<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider, XRTrackedImage, ARTrackedImage>
    ARTrackedImageManager
    Inherited Members
    ARTrackableManager<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider, XRTrackedImage, ARTrackedImage>.trackables
    ARTrackableManager<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider, XRTrackedImage, ARTrackedImage>.SetTrackablesActive(bool)
    SubsystemLifecycleManager<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.subsystem
    SubsystemLifecycleManager<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.descriptor
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    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.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.ARFoundation
    Assembly: Unity.XR.ARFoundation.dll
    Syntax
    [DefaultExecutionOrder(-2147483647)]
    [RequireComponent(typeof(XROrigin))]
    public sealed class ARTrackedImageManager : ARTrackableManager<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider, XRTrackedImage, ARTrackedImage>
    Remarks

    Related information: AR Tracked Image Manager component

    Properties

    currentMaxNumberOfMovingImages

    Get the maximum number of moving images to track in real time that is currently in use by the subsystem.

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

    gameObjectName

    The name to be used for the GameObject whenever a new image is detected.

    Declaration
    protected override string gameObjectName { get; }
    Property Value
    Type Description
    string
    Overrides
    ARTrackableManager<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider, XRTrackedImage, ARTrackedImage>.gameObjectName

    maxNumberOfMovingImages

    The maximum number of moving images to track in real time. This property is obsolete. Use requestedMaxNumberOfMovingImages or currentMaxNumberOfMovingImages instead.

    Declaration
    [Obsolete("Use requestedMaxNumberOfMovingImages or currentMaxNumberOfMovingImages instead. (2020-01-16)")]
    public int maxNumberOfMovingImages { get; set; }
    Property Value
    Type Description
    int

    referenceLibrary

    Get or set the reference image library (that is, the set of images to search for in the physical environment).

    Declaration
    public IReferenceImageLibrary referenceLibrary { get; set; }
    Property Value
    Type Description
    IReferenceImageLibrary
    Remarks

    An IReferenceImageLibrary can be either an XRReferenceImageLibrary or a RuntimeReferenceImageLibrary. XRReferenceImageLibrarys can only be constructed in the Editor and are immutable at runtime. A RuntimeReferenceImageLibrary is the runtime representation of a XRReferenceImageLibrary and can be mutable at runtime (see MutableRuntimeReferenceImageLibrary).

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if the referenceLibrary is set to null while image tracking is enabled.

    requestedMaxNumberOfMovingImages

    The requested maximum number of moving images to track in real time. Support can vary between devices and providers. Check for support at runtime with descriptor's supportsMovingImages property.

    Declaration
    public int requestedMaxNumberOfMovingImages { get; set; }
    Property Value
    Type Description
    int

    trackedImagePrefab

    If not null, instantiates this Prefab for each detected image.

    Declaration
    public GameObject trackedImagePrefab { get; set; }
    Property Value
    Type Description
    GameObject
    Remarks

    The purpose of this property is to extend the functionality of ARTrackedImages. It is not the recommended way to instantiate content associated with an ARTrackedImage.

    Methods

    CreateRuntimeLibrary(XRReferenceImageLibrary)

    Creates a UnityEngine.XR.ARSubsystems.RuntimeReferenceImageLibrary from an existing UnityEngine.XR.ARSubsystems.XRReferenceImageLibrary or an empty library if serializedLibrary is null. Use this to construct reference image libraries at runtime. If the library is of type MutableRuntimeReferenceImageLibrary, it is modifiable at runtime.

    Declaration
    public RuntimeReferenceImageLibrary CreateRuntimeLibrary(XRReferenceImageLibrary serializedLibrary = null)
    Parameters
    Type Name Description
    XRReferenceImageLibrary serializedLibrary

    An existing XRReferenceImageLibrary, or null to create an empty mutable image library.

    Returns
    Type Description
    RuntimeReferenceImageLibrary

    A new RuntimeReferenceImageLibrary representing the deserialized version of serializedLibrary or an empty library if serializedLibrary is null.

    Exceptions
    Type Condition
    NotSupportedException

    Thrown if there is no subsystem. This usually means image tracking is not supported.

    GetPrefab()

    Get the Prefab that will be instantiated for each ARTrackedImage.

    Declaration
    protected override GameObject GetPrefab()
    Returns
    Type Description
    GameObject

    The Prefab that will be instantiated for each ARTrackedImage.

    Overrides
    ARTrackableManager<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider, XRTrackedImage, ARTrackedImage>.GetPrefab()

    OnAfterSetSessionRelativeData(ARTrackedImage, XRTrackedImage)

    Invoked just after updating each ARTrackedImage. Used to update the referenceImage.

    Declaration
    protected override void OnAfterSetSessionRelativeData(ARTrackedImage image, XRTrackedImage sessionRelativeData)
    Parameters
    Type Name Description
    ARTrackedImage image

    The tracked image being updated.

    XRTrackedImage sessionRelativeData

    New data associated with the tracked image. Spatial data is relative to the Unity.XR.CoreUtils.XROrigin.

    Overrides
    ARTrackableManager<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider, XRTrackedImage, ARTrackedImage>.OnAfterSetSessionRelativeData(ARTrackedImage, XRTrackedImage)

    OnBeforeStart()

    Sets the image library on the subsystem before Start() is called on the XRImageTrackingSubsystem.

    Declaration
    protected override void OnBeforeStart()
    Overrides
    SubsystemLifecycleManager<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.OnBeforeStart()

    OnTrackablesChanged(List<ARTrackedImage>, List<ARTrackedImage>, List<ARTrackedImage>)

    Invokes the trackedImagesChanged event.

    Declaration
    protected override void OnTrackablesChanged(List<ARTrackedImage> added, List<ARTrackedImage> updated, List<ARTrackedImage> removed)
    Parameters
    Type Name Description
    List<ARTrackedImage> added

    A list of images added this frame.

    List<ARTrackedImage> updated

    A list of images updated this frame.

    List<ARTrackedImage> removed

    A list of images removed this frame.

    Overrides
    ARTrackableManager<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider, XRTrackedImage, ARTrackedImage>.OnTrackablesChanged(List<ARTrackedImage>, List<ARTrackedImage>, List<ARTrackedImage>)

    Events

    trackedImagesChanged

    Invoked once per frame with information about the ARTrackedImages that have changed (that is, been added, updated, or removed). This happens just before ARTrackedImages are destroyed, so you can set ARTrackedImage.destroyOnRemoval to false from this event to suppress this behavior.

    Declaration
    public event Action<ARTrackedImagesChangedEventArgs> trackedImagesChanged
    Event Type
    Type Description
    Action<ARTrackedImagesChangedEventArgs>
    In This Article
    Back to top
    Copyright © 2025 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)