- Home /
GuiSkin - Creating a 2nd button?
Hi
Is it possible to use one GuiSkin but have two button settings?
So that, i can pick between button1 or button2 textures. Essentially customizing the GuiSkin further...
You have box, button, label, toggle... i want, box, button, button2, label, toggle...
Thankyou
Answer by Bunny83 · Jul 26, 2013 at 01:01 PM
You can add as much styles as you like to a GUISkin. Just take a look at the very bottom of the GUISkin. There's an array with custom styles. MyGUISkin currently has 108 custom styles. I don't use any of the default styles.
Keep in mind that you can simply use a custom style like this:
GUI.skin = mySkin;
// ...
GUILayout.Button("Button123", "MyCustomStyleName");
Actually i would prefer if Unity would drop the default styles and just keep the custom array. When you create a new Skin they could initialize the array with the default styles, but you could remove them if not needed. The default styles makes it difficult to serialize a GUISkin.