how do i change the gui skins?

i am trying to make a simple gui for my game(its called “Apocalypse”), but i dont like the gui skin wich unity uses. i am pretty sure thers a way to change it but i dont know how.

please help me, the faith of the apocalypse depends on you :stuck_out_tongue:

thanks in advance :smile:

You can create a new GUISkin asset from the editor (menu: Assets > Create > GUI Skin) and edit its settings. Then, in your GUI script set the GUI.skin property to your new skin:-

var newSkin: GUISkin;   //  Assign this in the inspector.

function OnGUI() {
    GUI.skin = newSkin;
}

I’m lost here. Where do I put that code? Does this involve creating prefabs? Is this only available in Pro? I’ve got a picture of where I’m at but no clue how I’m supposed to run the code you’ve got written.

330961--11647--$new_picture_160.jpg

I’ve tried to follow the tutorials but every instance of code I create says it’s waiting to compile but never finishes compiling.

You can run that code by putting it in a JavaScript file and then attaching that file to a GameObject. Typically, you would create an empty GameObject in the scene (menu: GameObject > Create Empty), and add your GUI code to that.

I have done this but the skin in the inspector doesn’t seem connected to the code. I’m assuming newSkin is what you name the asset as well? What am I missing?

Scratch that last question. I just tried tried dragging the assent into the variable and oddly enough that worked.

Why does it need to be called in OnGUI? It’s BS.