docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ARMeshManager

    A manager for triangle meshes generated by an AR device. Creates, updates, and removes GameObjects in response to the environment. For each mesh, a meshPrefab is instantiated which must contain at least a MeshFilter. If the meshPrefab's GameObject also has a MeshCollider, then a physics mesh is generated asynchronously, without blocking the main thread.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    ARMeshManager
    Inherited Members
    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.destroyCancellationToken
    MonoBehaviour.useGUILayout
    MonoBehaviour.didStart
    MonoBehaviour.didAwake
    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.GetComponentIndex()
    Component.CompareTag(string)
    Component.CompareTag(TagHandle)
    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.transformHandle
    Component.gameObject
    Component.tag
    Object.GetEntityId()
    Object.MemberwiseClone()
    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.InstantiateAsync<T>(T, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    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.FindObjectsByType(Type)
    Object.FindObjectsByType(Type, FindObjectsInactive)
    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.FindObjectsByType<T>()
    Object.FindObjectsByType<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.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.ARFoundation
    Assembly: Unity.XR.ARFoundation.dll
    Syntax
    [DefaultExecutionOrder(-2147483647)]
    [DisallowMultipleComponent]
    [AddComponentMenu("XR/AR Foundation/AR Mesh Manager")]
    [Icon("Packages/com.unity.xr.arfoundation/Editor/Icons/d_ARVR@4x.png")]
    public class ARMeshManager : MonoBehaviour
    Remarks

    Related information: AR Mesh Manager component

    Fields

    meshInfosChanged

    Invoked whenever meshes have changed (been added, updated, or removed).

    Declaration
    public UnityEvent<ARMeshInfosChangedEventArgs> meshInfosChanged
    Field Value
    Type Description
    UnityEvent<ARMeshInfosChangedEventArgs>

    Properties

    colors

    If true, requests a color value for each vertex in generated meshes.

    Declaration
    public bool colors { get; set; }
    Property Value
    Type Description
    bool

    concurrentQueueSize

    The number of meshes to process concurrently. Meshes are processed on a background thread. Higher numbers will require additional CPU time.

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

    density

    The density of the generated mesh [0..1]. 1 will be densely tessellated, while 0 will have the lowest supported tessellation.

    Declaration
    public float density { get; set; }
    Property Value
    Type Description
    float

    meshPrefab

    A Prefab to be instantiated for each generated mesh. The Prefab must have at least a MeshFilter component on it. If it also has a MeshCollider component, the physics bounding volume data will be generated asynchronously. This does not block the main thread, but might take longer to process.

    Declaration
    public MeshFilter meshPrefab { get; set; }
    Property Value
    Type Description
    MeshFilter

    meshes

    Returns a collection of MeshFilters that represents meshes generated by this component.

    Declaration
    public IList<MeshFilter> meshes { get; }
    Property Value
    Type Description
    IList<MeshFilter>

    normals

    If true, requests a normal for each vertex in generated meshes.

    Declaration
    public bool normals { get; set; }
    Property Value
    Type Description
    bool

    submeshClassificationEnabled

    Gets or sets the current enabled state of submesh classification. Note that some providers may require a restart if this value is changed in order to reflect the new setting.

    Declaration
    public bool submeshClassificationEnabled { get; set; }
    Property Value
    Type Description
    bool

    subsystem

    The XRMeshSubsystem used by this component to generate meshes.

    Declaration
    public XRMeshSubsystem subsystem { get; }
    Property Value
    Type Description
    XRMeshSubsystem

    tangents

    If true, requests a tangent for each vertex in generated meshes.

    Declaration
    public bool tangents { get; set; }
    Property Value
    Type Description
    bool

    textureCoordinates

    If true, requests a texture coordinate for each vertex in generated meshes.

    Declaration
    public bool textureCoordinates { get; set; }
    Property Value
    Type Description
    bool

    Methods

    DestroyAllMeshes()

    Destroys all generated meshes and ignores any pending meshes.

    Declaration
    public void DestroyAllMeshes()

    TryGetSubmeshClassifications(TrackableId, Allocator, out uint, out NativeArray<uint>, out NativeArray<uint>)

    Gets classification information for vertices or vertex sets for meshes obtained through [meshInfosChanged]. This must be enabled through [submeshClassificationEnabled].

    Declaration
    public bool TryGetSubmeshClassifications(TrackableId id, Allocator allocator, out uint indexVectorLength, out NativeArray<uint> vertexIndexVectors, out NativeArray<uint> classifications)
    Parameters
    Type Name Description
    TrackableId id

    The TrackableId of the mesh to obtain classifications for

    Allocator allocator

    The Allocator type the [vertexIndexVectors] and [classifications] NativeArrays should be created with.

    uint indexVectorLength

    The number of vertex indices packed in [vertexIndexVectors] that should be considered as one classified element, e.g. 1 for a single vertex, or 3 for a triangle face.

    NativeArray<uint> vertexIndexVectors

    The packed vertex indices that are classified, collated with the applicable [classifications]

    NativeArray<uint> classifications

    The classifications for the mesh components describing the vertex indices

    Returns
    Type Description
    bool

    Events

    meshesChanged

    Invoked whenever meshes have changed (been added, updated, or removed).

    Declaration
    [Obsolete("meshesChanged is deprecated in AR Foundation 6.4. Use meshInfosChanged instead", true)]
    public event Action<ARMeshesChangedEventArgs> meshesChanged
    Event Type
    Type Description
    Action<ARMeshesChangedEventArgs>
    In This Article
    Back to top
    Copyright © 2026 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)