Class ScreenSpaceRotateInput
Component that provides the twist rotation or two finger drag value from a touchscreen for mobile AR. Intended to be used with an XRInputValueReader as its object reference to provide a rotation value.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.AR.Inputs
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("XR/Input/Screen Space Rotate Input", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.AR.Inputs.ScreenSpaceRotateInput.html")]
public class ScreenSpaceRotateInput : MonoBehaviour, IXRInputValueReader<Vector2>, IXRInputValueReader
Properties
dragDeltaInput
Input to use for the screen drag delta relative to the previous frame.
Declaration
public XRInputValueReader<Vector2> dragDeltaInput { get; set; }
Property Value
Type | Description |
---|---|
XRInputValueReader<Vector2> |
See Also
rayInteractor
The ray interactor to get the attach transform from.
Declaration
public XRRayInteractor rayInteractor { get; set; }
Property Value
Type | Description |
---|---|
XRRayInteractor |
See Also
screenTouchCountInput
The input used to read the screen touch count value.
Declaration
public XRInputValueReader<int> screenTouchCountInput { get; set; }
Property Value
Type | Description |
---|---|
XRInputValueReader<int> |
See Also
twistDeltaRotationInput
Input to use for the screen twist delta relative to the previous frame.
Declaration
public XRInputValueReader<float> twistDeltaRotationInput { get; set; }
Property Value
Type | Description |
---|---|
XRInputValueReader<float> |
See Also
Methods
Awake()
See MonoBehaviour.
Declaration
protected void Awake()
See Also
OnDisable()
See MonoBehaviour.
Declaration
protected void OnDisable()
See Also
OnEnable()
See MonoBehaviour.
Declaration
protected void OnEnable()
See Also
ReadValue()
Read the current value from the input source.
Declaration
public Vector2 ReadValue()
Returns
Type | Description |
---|---|
Vector2 | Returns the current value from the input source. May return |
See Also
Reset()
See MonoBehaviour.
Declaration
[Conditional("UNITY_EDITOR")]
protected void Reset()
See Also
TryReadValue(out Vector2)
Try to read the current value from the input source.
Declaration
public bool TryReadValue(out Vector2 value)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | value | When this method returns, contains the current value from the input source. May return |
Returns
Type | Description |
---|---|
bool | Returns true if the current value was able to be read (and for actions, also if in progress). |
Remarks
You can use the return value of this method instead of only using ReadValue() in order to avoid doing
any work when the input action is not in progress, such as when the control is not actuated.
This can be useful for performance reasons.
If an input processor on an input action returns a different value from the default Vector2
when the input action is not in progress, the outvalue
returned by
this method may not be default(TValue)
as is typically the case for Try
- methods. If you need
to support processors that return a different value from the default when the control is not actuated,
you should use ReadValue() instead of using the return value of this method to skip input handling.