Пример #1
0
        private static void DrawLayer(int instanceID, Rect selectionRect)
        {
            if (!data.layer.GetEnabled())
            {
                return;
            }

            string layer = LayerMask.LayerToName(currentGO.layer);

            /* Draw text */
            if (data.layer.enabledText)
            {
                float offset = GUI.skin.label.CalcSize(new GUIContent(layer)).x;

                Rect rect = selectionRect;
                rect.x = selectionRect.xMax - RIGHT_BOUNDARY - offset + (ROW_HEIGHT - 1) - MAX_INSTID_LEN;

                GUIStyle style = new GUIStyle();
                style.normal.textColor = (layer == "Default") ? data.layer.textColorDefault : data.layer.textColor;

                GUI.Label(rect, layer, style);
            }

            /* Draw item ovelay */
            if (data.layer.enabledItem)
            {
                Color color           = data.layer.GetColorByLayer(layer);
                bool  invertDirection = data.layer.invertDirection;
                float startTime       = data.layer.gradientLength;

                HierarchyRenderer.DrawOverlayByDrawMode(
                    selectionRect, currentItem.nestingLevel, color, DrawMode.GRADIENT, startTime, invertDirection);
            }
        }
Пример #2
0
        private static void DrawTag(int instanceID, Rect selectionRect)
        {
            if (!data.tag.GetEnabled())
            {
                return;
            }

            string tag = currentGO.tag;

            /* Draw text */
            if (data.tag.enabledText)
            {
                float offset = GUI.skin.label.CalcSize(new GUIContent(tag)).x;

                Rect rect = selectionRect;
                rect.x = selectionRect.xMax - RIGHT_BOUNDARY - offset + (ROW_HEIGHT - 1) - MAX_LAYER_LEN - MAX_INSTID_LEN;

                GUIStyle style = new GUIStyle();
                style.normal.textColor = (tag == "Untagged") ? data.tag.textColorUntagged : data.tag.textColor;

                GUI.Label(rect, tag, style);
            }

            /* Draw item ovelay */
            if (data.tag.enabledItem)
            {
                Color color           = data.tag.GetColorByTag(tag);
                bool  invertDirection = data.tag.invertDirection;
                float startTime       = data.tag.gradientLength;

                HierarchyRenderer.DrawOverlayByDrawMode(
                    selectionRect, currentItem.nestingLevel, color, DrawMode.GRADIENT, startTime, invertDirection);
            }
        }