|
@@ -7,6 +7,7 @@ using UnityEngine.EventSystems;
|
|
|
using UnityEngine.UI;
|
|
|
using SC.XR.Unity;
|
|
|
using XRTool.Util;
|
|
|
+using SC.XR.Unity.Module_InputSystem.InputDeviceHead;
|
|
|
|
|
|
public class MenuUI : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
|
|
|
{
|
|
@@ -216,13 +217,18 @@ public class MenuUI : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHa
|
|
|
public void OnDrag(PointerEventData eventData)
|
|
|
{
|
|
|
SCPointEventData sed = eventData as SCPointEventData;
|
|
|
+ if(sed.inputDevicePartBase is InputDeviceHeadPart)
|
|
|
+ {
|
|
|
+ sed.inputDevicePartBase.transform.position = OpenXRCamera.Instance.head.position;
|
|
|
+ sed.inputDevicePartBase.transform.eulerAngles = OpenXRCamera.Instance.head.eulerAngles;
|
|
|
+ }
|
|
|
ob.transform.position = (eventData as SCPointEventData).PressPosition3D;
|
|
|
float ox = ob.transform.localPosition.x;
|
|
|
|
|
|
float _delta = (bx - ox)*100;
|
|
|
bx = ox;
|
|
|
-
|
|
|
- if (_delta < -0.01f)
|
|
|
+ Debug.Log("_delta===>"+_delta);
|
|
|
+ if (_delta < -0.1f)
|
|
|
{
|
|
|
|
|
|
|
|
@@ -310,7 +316,7 @@ public class MenuUI : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHa
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- else if (_delta > 0.01f)
|
|
|
+ else if (_delta > 0.1f)
|
|
|
{
|
|
|
|
|
|
_isInLeft = false;
|