- Home /
Changing default GUISkin
Hi,
I made one GUISkin for my entire game and would also like that any GUI call uses this one by default. I know you can set the GUIskin by "GUI.skin = mySkin", but I have a few questions about this:
1) Can I make it so I don't even have to write that line of code ? Just change the default GUISkin in my game settings ?
2) When I use "GUI.skin = mySkin" will ALL GUI calls use this then, even the ones in other scripts? And when a new scene is loaded, will the new GUI skin be used ?
3) When I can't change the default GUISkin and "GUI.skin = mySkin" is for everything, is there a build-in way to let a script be executed at the start of the game (without having to add it to an object)? So I can just write the "GUI.skin = mySkin" line once there and it works ? :P
Thanks !
Answer by syclamoth · Oct 22, 2011 at 02:08 PM
No.
Yes.
No. However, it's really not that hard to just put it at the top of any one of your GUI scripts (as in, in Awake()), which amounts to the same thing.
Ooh :(
Yey :D Thanks
I know :P But it's just more convenient to have one place to set this (there might be more stuff I want to set there)
Thanks ! :D
If you want to put a bunch of init settings in one place, you could have an empty gameObject with a single script on it (your initialisation script), then set up in the Execution Order settings so that that script is guaranteed to execute before anything else in the scene. If it's that important, it could even auto-destroy itself when it no longer has anything to do!
Your answer