- Home /
How to delete a custom style from a GUISkin?
I have created a bunch of custom styles (on multiple skins, but that's a different story) in one skin in particular and as my knowledge of the UnityGUI and GUISkin has evolved, I no longer require as many custom styles. Short of creating a whole new GUISkin and only adding the newly required custom styles to it (A huge pain) .. is there a way to simply delete or remove the custom styles I no longer need?
Summary: How Do I delete a custom style from a Skin without start a whole new skin?
Thanks!
Well, the problem is that the custom styles is an array. Normally arrays can't drop items inbetween. Only at the end. I've read somewhere that there's a keyboard hotkey for inserting and deleting items from an array in the inspector but unfortunately i can't remember it :D
Just tried it. SHIFT + $$anonymous$$ will remove the current selected element ;) Can't find the hotkey for inserting... :|
Answer by Bunny83 · Apr 29, 2011 at 06:07 PM
Ok, got it :D
- To delete an element in an array just select the element and press SHIFT + DEL
- To insert an element into an array select an exisiting element and press CTRL + D. That will duplicate the current element and insert it below the original.
Thanks Bunny! .. Before co$$anonymous$$g back to this post I tried selecting the style and hitting delete and it worked .. you've confirmed my findings. Thanks for the input shortcut .. that has been a question of $$anonymous$$e as well for a long time.
Thanks!
You're right. For arrays of simple value types like int[], string[]... just press $$anonymous$$. But reference types like GameObject[], Transform[] ... when you press $$anonymous$$ you set the reference to null. For such arrays you have to use SHIFT+$$anonymous$$... That's some knowledge i've gained a long time ago but i can't remember it.
Your answer
Follow this Question
Related Questions
Why can't I access the Name field in the Custom Styles section of a GUISkin in the Inspector? 2 Answers
Why is texture blurred in one GuiStyle and not in another? 1 Answer
Problems controlling the GUI skin / style 2 Answers
Understanding GUISkin/GUIStyle BackgroundImage and Border 2 Answers
Using GUISkin with Hierachy Objects 0 Answers