Class ARPlaneManager
A manager for ARPlanes. Creates, updates, and removes
GameObjects in response to detected surfaces in the physical
environment.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
Syntax
public sealed class ARPlaneManager : ARTrackableManager<XRPlaneSubsystem, XRPlaneSubsystemDescriptor, BoundedPlane, ARPlane>, IRaycaster
Properties
detectionMode
Get or set the PlaneDetectionMode to use for plane detection.
Declaration
public PlaneDetectionMode detectionMode { get; set; }
Property Value
| Type | Description |
|---|---|
| PlaneDetectionMode |
gameObjectName
The name to be used for the GameObject whenever a new plane is detected.
Declaration
protected override string gameObjectName { get; }
Property Value
| Type | Description |
|---|---|
| String |
Overrides
planePrefab
Getter/setter for the Plane Prefab.
Declaration
public GameObject planePrefab { get; set; }
Property Value
| Type | Description |
|---|---|
| GameObject |
Methods
GetPlane(TrackableId)
Attempt to retrieve an existing ARPlane by trackableId.
Declaration
public ARPlane GetPlane(TrackableId trackableId)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackableId | trackableId | The |
Returns
| Type | Description |
|---|---|
| ARPlane | The ARPlane with |
GetPrefab()
Declaration
protected override GameObject GetPrefab()
Returns
| Type | Description |
|---|---|
| GameObject |
Overrides
OnAfterSetSessionRelativeData(ARPlane, BoundedPlane)
Declaration
protected override void OnAfterSetSessionRelativeData(ARPlane plane, BoundedPlane sessionRelativeData)
Parameters
| Type | Name | Description |
|---|---|---|
| ARPlane | plane | |
| BoundedPlane | sessionRelativeData |
Overrides
OnBeforeStart()
Declaration
protected override void OnBeforeStart()
Overrides
OnDisable()
Declaration
protected override void OnDisable()
Overrides
OnEnable()
Declaration
protected override void OnEnable()
Overrides
OnTrackablesChanged(List<ARPlane>, List<ARPlane>, List<ARPlane>)
Declaration
protected override void OnTrackablesChanged(List<ARPlane> added, List<ARPlane> updated, List<ARPlane> removed)
Parameters
| Type | Name | Description |
|---|---|---|
| List<ARPlane> | added | |
| List<ARPlane> | updated | |
| List<ARPlane> | removed |
Overrides
Raycast(Ray, TrackableType, Allocator)
Performs a raycast against all currently tracked planes.
Declaration
public NativeArray<XRRaycastHit> Raycast(Ray ray, TrackableType trackableTypeMask, Allocator allocator)
Parameters
| Type | Name | Description |
|---|---|---|
| Ray | ray | The ray, in Unity world space, to cast. |
| TrackableType | trackableTypeMask | A mask of raycast types to perform. |
| Allocator | allocator | The |
Returns
| Type | Description |
|---|---|
| NativeArray<XRRaycastHit> | A new |
See Also
Events
planesChanged
Invoked when planes have changed (been added, updated, or removed).
Declaration
public event Action<ARPlanesChangedEventArgs> planesChanged
Event Type
| Type | Description |
|---|---|
| Action<ARPlanesChangedEventArgs> |