EditorGUILayout.Popup() wrong position
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?
pasted-image-19-10-16-21-50.png
(130.8 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612095011im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
2+ level Popup on InspectorGUI 1 Answer
How to add Texture2D to Popup/Dropdown 0 Answers
Popup to choose which child class I want in Custom Editor Inspector 0 Answers
Is there a way for a public/serializedfield to be uneditable and just grayed out in the inspector? 1 Answer
assign variable by inspector failed... 2 Answers