void DetermineActiveChapter() { if (Mathf.Abs(rectTransform.anchoredPosition.y - restingY) > basePanelSeparation / 2) { if (activeChapter < chapterPanels.Length && rectTransform.anchoredPosition.y > restingY) { activeChapter++; UIChapterPanel.UpdateAllRestingY(); } else if (activeChapter > 1 && rectTransform.anchoredPosition.y <= restingY) { activeChapter--; UIChapterPanel.UpdateAllRestingY(); } } }
public static void ShiftToNewActivePanel(int newActiveChapter) { activeChapter = newActiveChapter; UIChapterPanel.UpdateAllRestingY(); }