public void ShiftWindowDown() { // попадает ли хвост в диапазон и отправлен ли запрос if (!(_currentBindRequest is BindNextRequest) && _bindings.ContainsFromTail(_preBoundaryThreshold, _window.Last.Value.LinkedData)) { _currentBindRequest = new BindNextRequest(this); _currentBindRequest.Execute(); } var next = _bindings.Find(_window.Last.Value.LinkedData).Next; // while scrolling up (moving down) if (next == null) { var measureCutting = new Straight { Direction = GrowDirection }; VectorGeneric2 firstIntersection; VectorGeneric2 lastIntersection; VectorGeneric2 boundIntersection; _window.First.Value.RectTransform.GetIntersectionInParentSpace(measureCutting, out firstIntersection); _window.Last.Value.RectTransform.GetIntersectionInParentSpace(measureCutting, out lastIntersection); RectTransform.GetIntersectionInLocalSpace(measureCutting, out boundIntersection); if (boundIntersection.Direction.sqrMagnitude < (lastIntersection.Target - firstIntersection.Origin).sqrMagnitude) { CarrierFactory.SetBumperCoDirection(this); } else { CarrierFactory.SetBumperCounterDirection(this); } return; } _itemFactory.Put(_window.First.Value); _window.RemoveFirst(); var cutting = new Straight { Direction = GrowDirection, }; VectorGeneric2 intersection; var item = _itemFactory.Get(next.Value); // TODO: one record cause en error here _window.Last.Value.RectTransform.GetIntersectionInParentSpace(cutting, out intersection); _window.AddLast(item); item.RectTransform.anchoredPosition = intersection.Target; if (ReferenceEquals(item.LinkedData, _bindings.Last.Value)) { OnCoDirectionBoundReach(); } }
public void ShiftWindowUp() { if (VisibleWindow.TryShiftUp()) { if (_chain.First.IsUpperHalf(_chain.First)) { _chain.LoadPreviousPage(); } } else { if (_chain.IsUpperLimit) { CarrierFactory.SetBumperCoDirection(this); } else { CarrierFactory.Suspend(); } } }