Inspector style constantly jumps between two styles

Hello,

ever since I added a EditorGUILayout.Popup("", 0, availableTypes,"button"); to my CustomEditor, the inspector constantly jumps back and forth between two different styles (see attached pictures), which makes it impossible to work with it.

Now the reason why I want the Popup to be drawn as “button”, is because I find it more logical in this case (it adds an object, and you select it’s type from a dropdown list).

I also noticed that the style it now jumps to (picture 1), is much nicer than the default style.

So the questions are:

  • Is there a way I can always have that style for my CustomEditor?
  • How can I have a EditorGUILayout.Popup drawn as a button without the constant style switching?

:face_with_spiral_eyes:

I hope you guys can help me, I’m kind of stuck here.

433253--15055--$style1.png
433253--15056--$style2.png

Hmm. I found out, the reason it happened was a different one - I folded up the Transform component! (how dare I)

Which just leaves the question - how can I always have that style?

Can you post the whole script that has this behaviour? It’s not easy to say why that line would be causing trouble when seen in isolation.

Alright… as it turned out it was not that specific line - but the combination of my CustomEditor with the Transform folded up.

I’ve attached the editor scripts (can’t include all the scripts it depends on though), as apparently it’s too long to fit as a post here.

435314–15134–$InteractableEditor.cs (7.99 KB)
435314–15135–$ScriptablesEditor.cs (7.21 KB)

I hope the script is not too complicated to be of any use…