- Home /
Accessing default resources
For example, how to access/change GUI.skin.toggle.normal.background outside of OnGUI()?
Comment
Answer by Joshua · Sep 06, 2011 at 05:49 AM
GUI.skin is a static variable, you can access it from where-ever.
Thats false. Referencing GUI.skin outside of OnGui resultsin the following exception:
ArgumentException: You can only call GUI functions from inside OnGUI.
UnityEngine.GUIUtility.CheckOnGUI ()
UnityEngine.GUI.get_skin ()
$$anonymous$$GUI2.$$anonymous$$2Label..ctor (System.String text) (at Assets/$$anonymous$$GUI2/scripts/components/$$anonymous$$2Label.cs:15)
$$anonymous$$2Test.Start () (at Assets/$$anonymous$$GUI2/scripts/$$anonymous$$2Test.cs:9)
You really should test your answers before giving them.
Your answer
Follow this Question
Related Questions
How to Edit a Copy of the Default Skin 1 Answer
How to use Resources in custom EditorWindow? 1 Answer
RTS Style building help 2 Answers
How to properly load textures? 2 Answers
[iOS] Can I include "Data" folder in resource when downloading resource? 0 Answers