- Home /
The question is answered, right answer was accepted
EditorGUI.Foldout -- Cannot interact with contents!
Quite simply, clicking on anything within an EditorGUI.Foldout will result in closing the Foldout. Also, if the clickable label is disabled, you can't interact with anything in at all.
:
If you have questions or need screenshots just ask! :D --- expat1999
I'd suggest not using foldouts, you can easily get the same effect with any other bool-based editor layout function and style.
Is this similar to your issue? https://answers.unity.com/questions/299618/unity-editor-keeping-your-foldout-from-collapsing.html
https://answers.unity.com/questions/684414/custom-editor-foldout-doesnt-unfold-when-clicking.html
Folder has a toggleOnLabelClick field. Are you using the constructor that utilises it?
Answer by expat1999 · Feb 25, 2018 at 02:04 AM
Found an answer to my own question in another Unity Answers post. It was probably worded better, judging by the comments on my own post, but here it is for those who may need it:
:
EditorGUI.Foldout consumes click so GUI.Button doesnt work when inside of foldout region.
:
The top reply makes use of EditorGui.BeginProperty, EditorGui.EndProperty as well as EditorGUIUtility.singleLineHeight (basically).
You might be the first person in the history of the Internet to recuse in this way...