protected void Shift(IScrollController <TData> controller, Vector2 delta) { ////! temporal - item height limit speed //delta = delta.magnitude > ScrollerExtensions.SCROLL_SPEED_LIMIT_F ? delta.normalized * ScrollerExtensions.SCROLL_SPEED_LIMIT_F : delta; var direction = new Straight { Direction = controller.GrowDirection }; VectorGeneric2 intersection; if (!controller.RectTransform.GetIntersectionInLocalSpace(direction, out intersection)) { return; } if (Vector2.Dot(delta, controller.GrowDirection) > 0) { var first = controller.FirstOrDefault(); if (first != null && !first.RectTransform.IsInsideParentSpace(intersection.Origin) && controller.RectTransform.IsOverlapsChild(controller.First().RectTransform)) { controller.ShiftWindowUp(); } } if (Vector2.Dot(delta, controller.GrowDirection) < 0) { var last = controller.LastOrDefault(); if (last != null && !last.RectTransform.IsInsideParentSpace(intersection.Target) && controller.RectTransform.IsOverlapsChild(controller.Last().RectTransform)) { controller.ShiftWindowDown(); } } }
public OneItemHopCounterDirectionCarrier(IScrollController <TData> controller) { var last = controller.LastOrDefault(); if (last == null) { return; } last.RectTransform.GetIntersectionInParentSpace(new Straight { Direction = controller.GrowDirection }, out _path); }