|
@@ -1,98 +0,0 @@
|
|
|
-using SC.XR.Unity.Module_InputSystem;
|
|
|
-using System;
|
|
|
-using System.Collections;
|
|
|
-using System.Collections.Generic;
|
|
|
-using UnityEngine;
|
|
|
-
|
|
|
-public class AllMoveEvent : MonoBehaviour
|
|
|
-{
|
|
|
-
|
|
|
- void Start()
|
|
|
- {
|
|
|
- DispatcherBase.KeyDownDelegateRegister(downEvent);
|
|
|
- DispatcherBase.KeyUpDelegateRegister(upEvent);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- InputDevicePartBase NowPart ;
|
|
|
-
|
|
|
- private void upEvent(InputKeyCode keyCode, InputDevicePartBase part)
|
|
|
- {
|
|
|
- if(part.inputDataBase.SCPointEventData.pointerCurrentRaycast.gameObject!=null&& part.inputDataBase.SCPointEventData.pointerCurrentRaycast.gameObject.GetComponent<BoxCollider>()==null)
|
|
|
- {
|
|
|
- checkMoveUp(part.inputDataBase.SCPointEventData.pointerCurrentRaycast.gameObject, part);
|
|
|
- }
|
|
|
- NowPart = null;
|
|
|
- }
|
|
|
-
|
|
|
- public void checkMoveUp(GameObject obj, InputDevicePartBase part)
|
|
|
- {
|
|
|
- if(obj)
|
|
|
- {
|
|
|
- ManipulationHandler m = obj.GetComponent<ManipulationHandler>();
|
|
|
- if(m!=null)
|
|
|
- {
|
|
|
- m.OnPointerUp(part.inputDataBase.SCPointEventData);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (obj.transform.parent != null)
|
|
|
- checkMoveUp(obj.transform.parent.gameObject, part);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private void downEvent(InputKeyCode keyCode, InputDevicePartBase part)
|
|
|
- {
|
|
|
- if (part.inputDataBase.SCPointEventData.pointerCurrentRaycast.gameObject != null && part.inputDataBase.SCPointEventData.pointerCurrentRaycast.gameObject.GetComponent<BoxCollider>() == null)
|
|
|
- {
|
|
|
- checkMoveDown(part.inputDataBase.SCPointEventData.pointerCurrentRaycast.gameObject, part);
|
|
|
- }
|
|
|
- NowPart = part;
|
|
|
- }
|
|
|
-
|
|
|
- public void checkMoveDown(GameObject obj, InputDevicePartBase part)
|
|
|
- {
|
|
|
- if (obj)
|
|
|
- {
|
|
|
- ManipulationHandler m = obj.GetComponent<ManipulationHandler>();
|
|
|
- if (m != null)
|
|
|
- {
|
|
|
- m.OnPointerDown(part.inputDataBase.SCPointEventData);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (obj.transform.parent != null)
|
|
|
- checkMoveDown(obj.transform.parent.gameObject, part);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- void Update()
|
|
|
- {
|
|
|
- if (NowPart!=null&&NowPart.inputDataBase.SCPointEventData.pointerCurrentRaycast.gameObject != null && NowPart.inputDataBase.SCPointEventData.pointerCurrentRaycast.gameObject.GetComponent<BoxCollider>() == null)
|
|
|
- {
|
|
|
-
|
|
|
- checkMoveDrag(NowPart.inputDataBase.SCPointEventData.pointerCurrentRaycast.gameObject, NowPart);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- public void checkMoveDrag(GameObject obj, InputDevicePartBase part)
|
|
|
- {
|
|
|
- if (obj)
|
|
|
- {
|
|
|
- ManipulationHandler m = obj.GetComponent<ManipulationHandler>();
|
|
|
- if (m != null)
|
|
|
- {
|
|
|
- m.OnDrag(part.inputDataBase.SCPointEventData);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if(obj.transform.parent!=null)
|
|
|
- checkMoveDrag(obj.transform.parent.gameObject, part);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|