|
@@ -23,8 +23,8 @@ namespace SC.XR.Unity.Module_InputSystem
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
public class ManipulationHandler : PointerHandler
|
|
|
{
|
|
|
|
|
@@ -61,6 +61,8 @@ namespace SC.XR.Unity.Module_InputSystem
|
|
|
public float minScaleRatio = 0.8f;
|
|
|
public float maxScaleRatio = 3f;
|
|
|
|
|
|
+
|
|
|
+ public bool isParentDrag;
|
|
|
public virtual void Start()
|
|
|
{
|
|
|
targetStartScale = Target == null ? transform.localScale : Target.localScale;
|
|
@@ -68,8 +70,6 @@ namespace SC.XR.Unity.Module_InputSystem
|
|
|
|
|
|
public override void OnPointerDown(PointerEventData eventData)
|
|
|
{
|
|
|
- xx = 0;
|
|
|
- yy = 0;
|
|
|
base.OnPointerDown(eventData);
|
|
|
|
|
|
if (eventDataDic == null)
|
|
@@ -135,8 +135,6 @@ namespace SC.XR.Unity.Module_InputSystem
|
|
|
|
|
|
public override void OnPointerUp(PointerEventData eventData)
|
|
|
{
|
|
|
- xx = 0;
|
|
|
- yy = 0;
|
|
|
base.OnPointerUp(eventData);
|
|
|
|
|
|
if (eventData is SCPointEventData)
|
|
@@ -162,8 +160,6 @@ namespace SC.XR.Unity.Module_InputSystem
|
|
|
}
|
|
|
AudioSystem.getInstance.PlayAudioOneShot(gameObject, EndAudio);
|
|
|
}
|
|
|
- float xx;
|
|
|
- float yy;
|
|
|
public override void OnDrag(PointerEventData eventData)
|
|
|
{
|
|
|
base.OnDrag(eventData);
|
|
@@ -174,8 +170,7 @@ namespace SC.XR.Unity.Module_InputSystem
|
|
|
}
|
|
|
|
|
|
Tuple<Vector3, Quaternion, Vector3> result = devicePartCountManipulation.Update(CaculateScaleConstraint);
|
|
|
- Vector3 v3Pos = result.Item1;
|
|
|
- Vector3 position = v3Pos;
|
|
|
+ Vector3 position = result.Item1;
|
|
|
Quaternion rotation = result.Item2;
|
|
|
Vector3 scale = result.Item3;
|
|
|
|
|
@@ -193,12 +188,6 @@ namespace SC.XR.Unity.Module_InputSystem
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private Vector3 GetBetweenPoint(Vector3 start, Vector3 end, float percent = 0.5f)
|
|
|
- {
|
|
|
- Vector3 normal = (end - start).normalized;
|
|
|
- float distance = Vector3.Distance(start, end);
|
|
|
- return normal * (distance * percent) + start;
|
|
|
- }
|
|
|
public override void OnPointerExit(PointerEventData eventData)
|
|
|
{
|
|
|
base.OnPointerExit(eventData);
|