set a skin to "on" state programatically


I would like to set the style of a gui component to "on" but I fail to find how I can achieve that by code. This is not a button or toggle, and I have to set it via code not via user input.

I looked at GUIStyle.Draw help section. It seems to give options to set the on state but I do not understand nor find examples on how to use this function.

Thanks for your input.



Looking for an answer to the same question...

I’ve had the same issue in the past and I ended up writing a class customized to my needs with toggle buttons. However, depending on your end goal, the GUI.Toolbar might work out for you. Here’s a link: