Esempio n. 1
0
        private static void PaintText(HierarchyItem item)
        {
            Color32 color;

            if (item.PrettyObject.UseDefaultTextColor || item.IsSelected)
            {
                color = EditorColors.GetDefaultTextColor(EditorUtils.IsHierarchyFocused, item.IsSelected, item.GameObject.activeInHierarchy);
            }
            else
            {
                color   = item.PrettyObject.TextColor;
                color.a = item.GameObject.activeInHierarchy ? EditorColors.TextAlphaObjectEnabled : EditorColors.TextAlphaObjectDisabled;
            }

            GUIStyle labelGUIStyle = new GUIStyle
            {
                normal = new GUIStyleState {
                    textColor = color
                },
                fontStyle = item.PrettyObject.FontStyle,
                alignment = item.PrettyObject.Alignment,
                fontSize  = item.PrettyObject.FontSize,
                font      = item.PrettyObject.Font
            };

            if (item.PrettyObject.TextDropShadow)
            {
                EditorGUI.DropShadowLabel(item.TextRect, item.PrettyObject.name, labelGUIStyle);
            }
            else
            {
                EditorGUI.LabelField(item.TextRect, item.PrettyObject.name, labelGUIStyle);
            }
        }
        private static void PaintText(HierarchyItem item)
        {
            Color color = item.IsSelected ? EditorColors.GetDefaultTextColor(EditorUtils.IsHierarchyFocused, item.IsSelected) : item.PrettyObject.TextColor;

            GUIStyle labelGUIStyle = new GUIStyle
            {
                normal = new GUIStyleState {
                    textColor = color
                },
                fontStyle = item.PrettyObject.FontStyle,
                alignment = item.PrettyObject.Alignment,
                fontSize  = item.PrettyObject.FontSize,
                font      = item.PrettyObject.Font
            };

            if (item.PrettyObject.TextDropShadow)
            {
                EditorGUI.DropShadowLabel(item.TextRect, item.PrettyObject.name, labelGUIStyle);
            }
            else
            {
                EditorGUI.LabelField(item.TextRect, item.PrettyObject.name, labelGUIStyle);
            }
        }