private static HandleTouchInfoDelegate TouchAreaHandlerWithEvents(OverlapPointDelegate overlapPoint, HandleTouchEventDelegate handler, Camera camera = null) { return(touch => { bool overlap = overlapPoint(touch.WorldPosition(camera)); bool overlapLastFrame = overlapPoint(touch.LastWorldPosition(camera)); if (overlap && overlapLastFrame) { handler(touch, ETouchEventType.IN); } if (overlap && !overlapLastFrame) { handler(touch, ETouchEventType.ENTER); } if (!overlap && overlapLastFrame) { handler(touch, ETouchEventType.EXIT); } }); }
public void ListenForTouchesOnOverlapWithEvents(OverlapPointDelegate overlapPoint, HandleTouchEventDelegate handler, Camera camera = null) { ListenForTouches(TouchAreaHandlerWithEvents(overlapPoint, handler, camera)); }