ScenarioPicker: find the list's ScrollRect while the panel is still inactive (play mode builds it before showing it); verify builds the real list inactive

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-10-23 01:40:51 +02:00
commit 2fb8e88fcf
3 changed files with 7 additions and 4 deletions

View file

@ -177,7 +177,8 @@ public sealed class ScenarioPicker
_scroll.onValueChanged.AddListener(_fit);
}
private static ScrollRect ScrollOf(PropertiesPanel panel) => (panel.Content ?? panel.transform).GetComponentInParent<ScrollRect>();
// The panel is inactive until the menu shows it, which is after Show builds it; an inactive ScrollRect still counts.
private static ScrollRect ScrollOf(PropertiesPanel panel) => (panel.Content ?? panel.transform).GetComponentInParent<ScrollRect>(true);
// Hides every list entry the viewport only partly shows, so the list ends on a whole row instead of slicing text.
private void FitViewport()