Accessing default resources

For example, how to access/change GUI.skin.toggle.normal.background outside of OnGUI()?

1 Answer

1

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 () KGUI2.K2Label..ctor (System.String text) (at Assets/KGUI2/scripts/components/K2Label.cs:15) K2Test.Start () (at Assets/KGUI2/scripts/K2Test.cs:9) You really should test your answers before giving them.