- Home /
GUI.Style is messing up big time
I'm seriously thinking about not even using this feature anymore. GUI.Style screws up all my other scripts even when that particular style isn't linked to the scripts it's messing up. I'd post my scripts, but I know that's not the problem. I have to shutdown Unity and restart it for it to not mess up my other scripts. Sometimes reopening it works and the textures of my other GUI components are alright, but sometimes they're not fixed and still using the other textures assigned by other GUI Styles in completely different scripts. I don't understand why it's doing this at all.
EX:
1) I make a scene, an empty object, attach script (Green), make gui.button (turns green)
2) I make a new scene, a new empty object, attach script (Red), make gui.button (turns red)
And now that number 2 was made, it's making number 1 red as well when it should be green even though they're seprate objects, scripts, and scenes. What's going on here? It's driving me nuts...
I set it like this
public GUIStyle hskin;
void OnGUI(){
}
How would you set it it?
I'm fairly new with it too, but your first explanation made more sense than the actual definition. Because it's changing my other GUI objects. Well, it's actually changing the other GUI objects that don't have styles attached, but I don't want styles attached to all of them.