Class ARScaleInteractable
Controls the scale of an object via a Pinch gesture. If an object is selected, then doing a pinch/zoom will modify the scale of the object.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.AR
Syntax
[AddComponentMenu("XR/AR Scale Interactable", 22)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.0/api/UnityEngine.XR.Interaction.Toolkit.AR.ARScaleInteractable.html")]
public class ARScaleInteractable : ARBaseGestureInteractable, IXRActivateInteractable, IXRHoverInteractable, IXRSelectInteractable, IXRInteractable
Properties
elasticity
Amount that the scale bounces back after hitting min/max of range.
Declaration
public float elasticity { get; set; }
Property Value
Type | Description |
---|---|
Single |
elasticRatioLimit
The limit of the elastic ratio.
Declaration
public float elasticRatioLimit { get; set; }
Property Value
Type | Description |
---|---|
Single |
maxScale
The maximum scale of the object.
Declaration
public float maxScale { get; set; }
Property Value
Type | Description |
---|---|
Single |
minScale
The minimum scale of the object.
Declaration
public float minScale { get; set; }
Property Value
Type | Description |
---|---|
Single |
sensitivity
Sensitivity to movement being translated into scale.
Declaration
public float sensitivity { get; set; }
Property Value
Type | Description |
---|---|
Single |
Methods
CanStartManipulationForGesture(PinchGesture)
Determines if the manipulation can start for the given gesture.
Declaration
protected override bool CanStartManipulationForGesture(PinchGesture gesture)
Parameters
Type | Name | Description |
---|---|---|
PinchGesture | gesture | The current gesture. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the manipulation can start. Otherwise, returns false. |
Overrides
OnContinueManipulation(PinchGesture)
Continues the scaling of the object.
Declaration
protected override void OnContinueManipulation(PinchGesture gesture)
Parameters
Type | Name | Description |
---|---|---|
PinchGesture | gesture | The current gesture. |
Overrides
See Also
OnEnable()
See MonoBehaviour.
Declaration
protected override void OnEnable()
Overrides
OnEndManipulation(PinchGesture)
Finishes the scaling of the object.
Declaration
protected override void OnEndManipulation(PinchGesture gesture)
Parameters
Type | Name | Description |
---|---|---|
PinchGesture | gesture | The current gesture. |
Overrides
See Also
OnStartManipulation(PinchGesture)
Recalculates the current scale ratio in case local scale, min or max scale were changed.
Declaration
protected override void OnStartManipulation(PinchGesture gesture)
Parameters
Type | Name | Description |
---|---|---|
PinchGesture | gesture | The gesture that started this transformation. |
Overrides
See Also
OnValidate()
See MonoBehaviour.
Declaration
protected void OnValidate()
ProcessInteractable(XRInteractionUpdateOrder.UpdatePhase)
The XRInteractionManager calls this method to update the Interactable.
Declaration
public override void ProcessInteractable(XRInteractionUpdateOrder.UpdatePhase updatePhase)
Parameters
Type | Name | Description |
---|---|---|
XRInteractionUpdateOrder.UpdatePhase | updatePhase | The update phase this is called during. |
Overrides
Remarks
Please see the XRInteractionManager and XRInteractionUpdateOrder.UpdatePhase documentation for more details on update order.