Class XRPlaneBuilder
Defines a fluent API for constructing an XRPlane.
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public class XRPlaneBuilder
Constructors
XRPlaneBuilder()
Construct an instance.
Declaration
public XRPlaneBuilder()
Methods
Build()
Build an output XRPlane using all this builder's parameter values.
Declaration
public XRPlane Build()
Returns
| Type | Description |
|---|---|
| XRPlane | The built |
FromBoundedPlane(XRPlane)
Copies values from an XRPlane to this instance.
Declaration
[Obsolete("FromBoundedPlane has been renamed in AR Foundation version 7.0. Use FromPlane instead. (UnityUpgradable) -> FromPlane(*)", true)]
public XRPlaneBuilder FromBoundedPlane(XRPlane plane)
Parameters
| Type | Name | Description |
|---|---|---|
| XRPlane | plane | The XRPlane values to copy to this instance. |
Returns
| Type | Description |
|---|---|
| XRPlaneBuilder | This instance. |
FromPlane(XRPlane)
Copies values from an XRPlane to this instance.
Declaration
public XRPlaneBuilder FromPlane(XRPlane plane)
Parameters
| Type | Name | Description |
|---|---|---|
| XRPlane | plane | The XRPlane values to copy to this instance. |
Returns
| Type | Description |
|---|---|
| XRPlaneBuilder | This instance. |
Reset()
Reset the instance to default values.
Declaration
public void Reset()
WithAlignment(PlaneAlignment)
Set the plane alignment for built XRPlane instances.
Declaration
public XRPlaneBuilder WithAlignment(PlaneAlignment alignment)
Parameters
| Type | Name | Description |
|---|---|---|
| PlaneAlignment | alignment | The plane alignment. |
Returns
| Type | Description |
|---|---|
| XRPlaneBuilder | This instance. |
WithCenter(Vector2)
Set the center for built XRPlane instances.
Declaration
public XRPlaneBuilder WithCenter(Vector2 center)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | center | The center. |
Returns
| Type | Description |
|---|---|
| XRPlaneBuilder | This instance. |
WithClassifications(PlaneClassifications)
Set the classifications for built XRPlane instances.
Declaration
public XRPlaneBuilder WithClassifications(PlaneClassifications classifications)
Parameters
| Type | Name | Description |
|---|---|---|
| PlaneClassifications | classifications | The classifications. |
Returns
| Type | Description |
|---|---|
| XRPlaneBuilder | This instance. |
WithNativePtr(IntPtr)
Set the native pointer for built XRPlane instances.
Declaration
public XRPlaneBuilder WithNativePtr(IntPtr nativePtr)
Parameters
| Type | Name | Description |
|---|---|---|
| IntPtr | nativePtr | The native pointer. |
Returns
| Type | Description |
|---|---|
| XRPlaneBuilder | This instance. |
WithParentId(TrackableId)
Set the parent ID for built XRPlane instances.
Declaration
public XRPlaneBuilder WithParentId(TrackableId parentId)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackableId | parentId | The parent ID. |
Returns
| Type | Description |
|---|---|
| XRPlaneBuilder | This instance. |
WithPose(Pose)
Set the pose for built XRPlane instances.
Declaration
public XRPlaneBuilder WithPose(Pose pose)
Parameters
| Type | Name | Description |
|---|---|---|
| Pose | pose | The pose. |
Returns
| Type | Description |
|---|---|
| XRPlaneBuilder | This instance. |
WithSize(Vector2)
Set the size for built XRPlane instances.
Declaration
public XRPlaneBuilder WithSize(Vector2 size)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | size | The size. |
Returns
| Type | Description |
|---|---|
| XRPlaneBuilder | This instance. |
WithSubsumedById(TrackableId)
Set the subsumed by ID for built XRPlane instances.
Declaration
public XRPlaneBuilder WithSubsumedById(TrackableId subsumedById)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackableId | subsumedById | The subsumed by ID. |
Returns
| Type | Description |
|---|---|
| XRPlaneBuilder | This instance. |
WithTrackableId(TrackableId)
Set the trackable ID for built XRPlane instances.
Declaration
public XRPlaneBuilder WithTrackableId(TrackableId trackableId)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackableId | trackableId | The trackable ID. |
Returns
| Type | Description |
|---|---|
| XRPlaneBuilder | This instance. |
WithTrackingState(TrackingState)
Set the tracking state for built XRPlane instances.
Declaration
public XRPlaneBuilder WithTrackingState(TrackingState trackingState)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackingState | trackingState | The tracking state. |
Returns
| Type | Description |
|---|---|
| XRPlaneBuilder | This instance. |