public void ScrollToFishProfile(FishDataObject fish, bool animate = true) { if (cellDict.TryGetValue(fish, out var profileCell)) { _scrollStart = scrollRect.verticalNormalizedPosition; _scrollTarget = scrollRect.GetTargetScrollValue(profileCell.rectTransform); _scrollAnimationT = 0f; _animatingScroll = true; } }
public static void CenterTransform(this ScrollRect scrollRect, RectTransform target) { scrollRect.verticalNormalizedPosition = scrollRect.GetTargetScrollValue(target); }