Skip to content

Commit

Permalink
Maroon-584 [MainMenu] Scroll up when loading a category's experiment …
Browse files Browse the repository at this point in the history
…selection (#585)

* Fully scroll up in experiments category in main menu

* Instantly scroll up
  • Loading branch information
FlorianGlawogger authored Feb 25, 2025
1 parent 06c9cd1 commit 0c57baf
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ private void Start()
newButton.GetComponent<Button>().onClick.AddListener(() =>
Maroon.GlobalEntities.SceneManager.Instance.LoadSceneRequest(current_scene));
}

// Force update canvases, to ensure scene buttons have been properly added
Canvas.ForceUpdateCanvases();

// Fully scroll up
ScrollRect experimentsScrollRect = ExperimentButtonsContainer.GetComponentInParent<ScrollRect>();
experimentsScrollRect.verticalNormalizedPosition = 1f;
}

private void OnClickGo()
Expand Down

0 comments on commit 0c57baf

Please sign in to comment.