cregox
1
Why this doesn't work? This is C#.
using UnityEngine;
using System.Collections;
public class Whatever : MonoBehaviour {
public string nomeAvatar = "";
public GUIStyle estiloNome = "label";
void OnGUI () {
nomeAvatar = GUI.TextField(new Rect(10,10,200,20), nomeAvatar, 25, estiloNome);
}
}
I wanted to have a custom GUIStyle in the inspector but default to "label".
jahroy
3
In UnityScript:
var estiloNome : GUIStyle = GUISkin.GetStyle("label");
system
2
Just declare ur GUISkin like this:
public GUISkin customSkin; (and don’t forget to put ur GuiSkin in this public var in Inspector window)
And in OnGui, just whrite
GUI.skin = customSkin;
Now, u just have to edit the different setting of ur GuiSkin in Inspector window…
ps: old answer but that can be helpfull for someonelse