I’m having weird behaviour when calling EditorGUILayout.Popup() within a loop. Only the first instance behaves correctly, all the others open shifted upwards, the last one on the top of the screen.
Doing something like this:
[CustomEditor(typeof(Configuration))]
public class ConfigInspector : Editor {
public override void OnInspectorGUI() {
Configuration config = (Configuration)target;
foreach (Property p in config.properties) {
p.index = EditorGUILayout.Popup("Slot "+p.slot, p.index, propertyList);
}
Whereas when I copy the code 5 times and change each instance everything behaves correctly.
Any idea why this behaviour and how to fix it?