public override PointersInputEventArgs GetPointerInputs() { Vector2 mousePos = UnityEngine.Input.mousePosition; Vector2 delta = mousePos - _formerPos; _formerPos = mousePos; RaycastAllResult result = raycastAt(mousePos); PointerInputEventArgs mousePointerInput = new PointerInputEventArgs(mousePos, delta, result.Hits, result.IsOverUI); return(new PointersInputEventArgs(new List <PointerInputEventArgs>() { mousePointerInput })); }
public override PointersInputEventArgs GetPointerInputs() { List <PointerInputEventArgs> pointerInputs = new List <PointerInputEventArgs>(); int border = Mathf.Min(_maxPointer, UnityEngine.Input.touchCount); for (int i = 0; i < border; i++) { Touch touch = UnityEngine.Input.touches[i]; Vector2 touchPos = touch.position; RaycastAllResult result = raycastAt(touchPos); PointerInputEventArgs touchPointerInput = new PointerInputEventArgs(touchPos, touch.deltaPosition, result.Hits, result.IsOverUI); pointerInputs.Add(touchPointerInput); } return(new PointersInputEventArgs(pointerInputs)); }