How can I attach a GUI Skin with Code. I only call my code during game play so I cant attach the skin in the inspector.
Thanks
How can I attach a GUI Skin with Code. I only call my code during game play so I cant attach the skin in the inspector.
Thanks
Use Resources.Load.
var GUISkin mySkin;
function Start()
{
mySkin = Resources.Load("MySkin");
}
function OnGUI()
{
GUI.skin = mySkin;
// Rest of gui code.
}
Here you are ;)