Class ARPlaneManager | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class ARPlaneManager

    Creates, updates, and removes GameObjects with ARPlane components under the ARSessionOrigin's trackablesParent.

    Inheritance
    System.Object
    ARPlaneManager
    Namespace: UnityEngine.XR.ARFoundation
    Syntax
    public sealed class ARPlaneManager : MonoBehaviour
    Remarks

    When enabled, this component subscribes to planeAdded, planeUpdated, and planeRemoved. If this component is disabled, and there are no other subscribers to those events, plane detection will be disabled on the device.

    Properties

    detectionFlags

    Get or set the PlaneDetectionFlags to use for plane detection.

    Declaration
    public PlaneDetectionFlags detectionFlags { get; set; }
    Property Value
    Type Description
    PlaneDetectionFlags

    planeCount

    Get the number of planes managed by this manager.

    Declaration
    public int planeCount { get; }
    Property Value
    Type Description
    System.Int32

    planePrefab

    Getter/setter for the Plane Prefab.

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

    Methods

    GetAllPlanes(List<ARPlane>)

    Get all currently tracked ARPlanes.

    Declaration
    public void GetAllPlanes(List<ARPlane> planes)
    Parameters
    Type Name Description
    List<ARPlane> planes

    Replaces the contents with the current list of planes.

    TryGetPlane(TrackableId)

    Attempts to retrieve an ARPlane.

    Declaration
    public ARPlane TryGetPlane(TrackableId planeId)
    Parameters
    Type Name Description
    TrackableId planeId

    The TrackableId associated with the ARPlane.

    Returns
    Type Description
    ARPlane

    The ARPlaneif found. null otherwise.

    Events

    planeAdded

    Raised for each new ARPlane detected in the environment.

    Declaration
    public event Action<ARPlaneAddedEventArgs> planeAdded
    Event Type
    Type Description
    Action<ARPlaneAddedEventArgs>

    planeRemoved

    Raised whenever an ARPlane is removed.

    Declaration
    public event Action<ARPlaneRemovedEventArgs> planeRemoved
    Event Type
    Type Description
    Action<ARPlaneRemovedEventArgs>

    planeUpdated

    Raised for each ARPlane every time it updates.

    Declaration
    public event Action<ARPlaneUpdatedEventArgs> planeUpdated
    Event Type
    Type Description
    Action<ARPlaneUpdatedEventArgs>
    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