Esempio n. 1
0
 public static void Label(GUIContent content, EditorLabelStyle style)
 {
     #if UNITY_EDITOR
     var oldBg = GUI.backgroundColor;
     GUI.backgroundColor = style.backgroundColor;
     var labelStyle = style.GetGUIStyle();
     GUILayout.Box(content, labelStyle);
     GUI.backgroundColor = oldBg;
     #endif
 }
Esempio n. 2
0
        public static void Label(Vector3 position, string text, EditorLabelStyle style, LabelSize size = LabelSize.Normal)
        {
#if UNITY_EDITOR
            if (string.IsNullOrEmpty(text))
            {
                return;
            }

            var oldBgColor = GUI.backgroundColor;
            GUI.backgroundColor = style.backgroundColor;
            GUIStyle guiStyle = SetLabelSize(style.GetGUIStyle(), size);
            Handles.Label(position, text, guiStyle);
            GUI.backgroundColor = oldBgColor;
#endif
        }