- Home /
Question by
Phenoxon · Jun 13, 2015 at 05:02 PM ·
unity5toggletoggle button
Persistent visual states for Toggle-as-a-button
From what I understand, the recommended way to create a button that functions as a toggle is to use something like:
GUILayout.Toggle(pressed, "Toggle me !", "Button");
However, this basically leads to the creation of a button with an On-value-changed event listener. The button graphics still function as if in a button rather than a toggle. i.e., when I press the button and release, the button does not retain the "pressed" graphic state. How can this be accomplished correctly?
Or alternatively, what is the best way to create a Toggle-without-a-checkbox-which-looks-like-a-button in Unity 5?
Thank you! P.S. If anybody is aware of a detailed guide that will be useful in this matter, please link me to it.
Comment