public void OnDrag(SongRouletteItem songRouletteItem, Vector2 dragDeltaInPixels) { dragDuration += Time.deltaTime; SlotListControl.OnDrag(songRouletteItem, dragDeltaInPixels); songRouletteItems.ForEach(it => SlotListControl.InterpolateSize(it)); if (DragSongRouletteItem != null) { DragDistance = DragSongRouletteItem.GetPosition() - dragStartPosition; } }
private void CheckStartFlickGesture(Vector2 dragDeltaInPixels) { if (dragDeltaInPixels.magnitude > FlickGestureThresholdInPixels) { IsFlickGesture = true; flickGestureWasNoTouchscreenPressed = false; // Calculate final velocity of dragged element. The flick-gesture will continue with this velocity. dragDuration += Time.deltaTime; Vector2 finalRouletteItemPosition = DragSongRouletteItem.GetPosition() + dragDeltaInPixels; Vector2 finalDragDistance = finalRouletteItemPosition - dragStartPosition; dragVelocity = finalDragDistance / dragDuration; } }