Esempio n. 1
0
 private void TouchDown(SInputTouch touch)
 {
     if (!EventSystem.current.IsPointerOverGameObject())
     {
         oldPosition = touch.screenPosition;
     }
 }
Esempio n. 2
0
 private void TouchMove(SInputTouch touch)
 {
     if (!EventSystem.current.IsPointerOverGameObject())
     {
         Vector3 direction = oldPosition - touch.screenPosition;
         direction.z        = direction.y;
         direction.y        = 0f;
         camTrans.position += direction * speed;
         oldPosition        = touch.screenPosition;
     }
 }
Esempio n. 3
0
        private SInputTouch CreateTouchData(Vector3 position)
        {
            Ray        ray = mainCamera.ScreenPointToRay(position);
            RaycastHit hit;

            Physics.Raycast(ray, out hit);

            SInputTouch touch = new SInputTouch {
                worldPosition  = hit.point,
                screenPosition = position,
                overGUI        = UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject(),
                gameObject     = hit.transform ? hit.transform.gameObject : null
            };

            return(touch);
        }
Esempio n. 4
0
 private void TouchUp(Vector3 position)
 {
     dataUp = CreateTouchData(position);
     InvokeOnTouchUp(dataUp);
 }
Esempio n. 5
0
 private void TouchDown(Vector3 position)
 {
     dataDown = CreateTouchData(position);
     InvokeOnTouchDown(dataDown);
 }
Esempio n. 6
0
 private void InvokeOnMouseMove(SInputTouch touch)
 {
     OnMouseMove?.Invoke(touch);
 }
Esempio n. 7
0
 private void InvokeOnTouchClick(SInputTouch touch)
 {
     OnTouchClick?.Invoke(touch);
 }
Esempio n. 8
0
 private void InvokeOnTouchUp(SInputTouch touch)
 {
     OnTouchUp?.Invoke(touch);
 }
Esempio n. 9
0
 private void InvokeOnTouchDown(SInputTouch touch)
 {
     OnTouchDown?.Invoke(touch);
 }