6 #if UNITY_WSA && UNITY_2017_2_OR_NEWER 11 namespace HoloToolkit.Unity.InputModule.Examples.Grabbables
19 #if UNITY_WSA && UNITY_2017_2_OR_NEWER 20 private Vector3 touchPositionFromController = Vector3.zero;
29 #if UNITY_WSA && UNITY_2017_2_OR_NEWER 30 InteractionManager.InteractionSourceUpdated += GetTouchPadPosition;
33 if (baseGrabbable == null)
35 baseGrabbable = GetComponent<BaseGrabbable>();
41 #if UNITY_WSA && UNITY_2017_2_OR_NEWER 42 InteractionManager.InteractionSourceUpdated -= GetTouchPadPosition;
56 #if UNITY_WSA && UNITY_2017_2_OR_NEWER 57 StartCoroutine(MakeRotate());
62 #if UNITY_WSA && UNITY_2017_2_OR_NEWER 63 private IEnumerator MakeRotate()
67 transform.Rotate(touchPositionFromController);
70 GetComponent<Rigidbody>().angularVelocity = Vector3.zero;
74 private void GetTouchPadPosition(InteractionSourceUpdatedEventArgs obj)
78 Debug.Log(
" obj.state.source.handedness =====" + obj.state.source.handedness +
" **** GrabberPriumary Handedness === " + baseGrabbable.
GrabberPrimary.Handedness);
79 if (obj.state.source.handedness == baseGrabbable.
GrabberPrimary.Handedness)
81 if (obj.state.touchpadTouched)
83 touchPositionFromController = obj.state.touchpadPosition;
84 touchPadPressed =
true;
88 touchPadPressed =
false;
94 private bool touchPadPressed;