- Home /
Selectable Editor List from an (dynamic) array
I'm trying to create a MenuItem command that when run, populates an array and displays a multi-selectable and scrollable list of that content. The content is dynamic and depends on what is selected upon execution of the command.
I have a static method that runs EditorWindow.GetWindow().Show() In OnGUI() I put my logic to populate the array and display it with a GUILayout.SelectionGrid() (or Toggle) enclosed in a GUILayout.BeginScrollView().
But I noticed that if I try to populate the array in OnGUI(), the GUILayout will constantly "refresh" I guess is the way I'd interpret it, making selection impossible (or scrolling). So it seems it would need to be run elsewhere, but I'm unsure where and how.
Please enlighten me if you could, Thank you.
Would you $$anonymous$$d posting your code so far? I'm not sure what the issue here is.