- Home /
Neutral state for toggle buttons?
Hello,
I'm trying to make a toggle button in my EditorWindow displaying multiple bool value, so I need a neutral state for the button, like this
But it seems there is no choice for neutral state.
Thanks
Answer by troien · Dec 05, 2014 at 10:43 AM
The sign inside that toggle means that you have 2 or more objects selected which have different values for the same boolean. To display this sign, you would need to set EditorGUI.showMixedValue to true before you call EditorGUI.Toggle (And probably set it to false afterwards)
If you want to use this inside an custom inspector, it is probably easier to work with SerializedProperty's. Sinse they handle this automatically. Make sure you use the CanEditMultipleObjects attribute though.
Your answer
![](https://koobas.hobune.stream/wayback/20220613173245im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Gui toggle active inactive states 3 Answers
Only one Checkbox (Bit toggle) at the time 2 Answers
Pause Button Problems 2 Answers
Get Mouse Events with EditorWindow 3 Answers
Close my GUI button by repressing the same Hot-key. 3 Answers