Class ARPlacementInteractable
Controls the placement of Andy objects via a tap gesture.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.AR
Syntax
public class ARPlacementInteractable : ARBaseGestureInteractable
Properties
fallbackLayerMask
The
Declaration
public LayerMask fallbackLayerMask { get; set; }
Property Value
Type | Description |
---|---|
LayerMask |
objectPlaced
Gets or sets the event that is called when this Interactable places a new
Declaration
public ARObjectPlacementEvent objectPlaced { get; set; }
Property Value
Type | Description |
---|---|
ARObjectPlacementEvent |
onObjectPlaced
Gets or sets the event that is called when this Interactable places a new
Declaration
public ARObjectPlacedEvent onObjectPlaced { get; set; }
Property Value
Type | Description |
---|---|
ARObjectPlacedEvent |
placementPrefab
A
Declaration
public GameObject placementPrefab { get; set; }
Property Value
Type | Description |
---|---|
GameObject |
Methods
CanStartManipulationForGesture(TapGesture)
Determines if the manipulation can be started for the given gesture.
Declaration
protected override bool CanStartManipulationForGesture(TapGesture gesture)
Parameters
Type | Name | Description |
---|---|---|
TapGesture | gesture | The current gesture. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the manipulation can be started. Otherwise, returns false. |
Overrides
OnEndManipulation(TapGesture)
Unity calls this method automatically when the manipulation is ended.
Declaration
protected override void OnEndManipulation(TapGesture gesture)
Parameters
Type | Name | Description |
---|---|---|
TapGesture | gesture | The current gesture. |
Overrides
See Also
OnObjectPlaced(ARObjectPlacementEventArgs)
This method is called after an object has been placed.
Declaration
protected virtual void OnObjectPlaced(ARObjectPlacementEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
ARObjectPlacementEventArgs | args | Event data containing a reference to the instantiated placement object. |
PlaceObject(Pose)
Instantiates the placement object and positions it at the desired pose.
Declaration
protected virtual GameObject PlaceObject(Pose pose)
Parameters
Type | Name | Description |
---|---|---|
Pose | pose | The pose at which the placement object will be instantiated. |
Returns
Type | Description |
---|---|
GameObject | Returns the instantiated placement object at the input pose. |
See Also
TryGetPlacementPose(TapGesture, out Pose)
Gets the pose for the object to be placed from a raycast hit triggered by a TapGesture.
Declaration
protected virtual bool TryGetPlacementPose(TapGesture gesture, out Pose pose)
Parameters
Type | Name | Description |
---|---|---|
TapGesture | gesture | The tap gesture that triggers the raycast. |
Pose | pose | When this method returns, contains the pose of the placement object based on the raycast hit. |
Returns
Type | Description |
---|---|
Boolean | Returns true if there is a valid raycast hit that hit the front of a plane. Otherwise, returns false. |