public override void OnPointerUp(ICustomEventData eventData) { thisEngine.WaitForNextTouch(); PushVelocityStack(eventData.velocity); Vector2 velocity = GetAverageVelocity(); eventData.SetVelocity(velocity); if (VelocityIsOverSwipeThreshold(eventData.velocity)) { thisEngine.SwipeUIE(eventData); } else { thisEngine.TapUIE(); } }
public override void OnPointerUp(ICustomEventData eventData) { thisEngine.WaitForNextTouch(); PushVelocityStack(eventData.velocity); Vector2 velocity = GetAverageVelocity(); eventData.SetVelocity(velocity); if (this.ShouldSwipe(eventData)) { thisEngine.SwipeUIE(eventData); } else { thisEngine.TapUIE(); } thisEngine.ClearTouchPosition(); }