public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            if (Event.current.type == EventType.Layout)
            {
                return;
            }                                                      // In [Expandable] popup it happens
            if (inspectorUtil.IsOutOfScreen(position))
            {
                return;
            }                                                     // Culling

            if (arraysSizeObserver.IsArraySizeChanged(property))
            {
                ResetCache();
            }

            rootDirectoryDrawer.RootDepth = property.depth;
            directoryDrawer.RootDepth     = property.depth;
            position = rootDirectoryDrawer.DrawPrefixLabel(position, property);

            int indentLevel = EditorGUI.indentLevel;

            EditorGUI.indentLevel = 0;

            position = DrawHeaderIfNeed(position, property);
            DrawLine(position, property, (slice, rect) => slice.Draw(rect));

            EditorGUI.indentLevel = indentLevel;
        }
Ejemplo n.º 2
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            if (inspectorUtil.IsOutOfScreen(position))
            {
                return;
            }
            if (inspectorUtil.IsWindowWidthChanged())
            {
                ResetCache();
            }
            if (arraysSizeObserver.IsArraySizeChanged(property))
            {
                ResetCache();
            }

            Profiler.BeginSample("OneLine.OnGUI");
            position = rootDirectoryDrawer.DrawPrefixLabel(position, property);

            int indentLevel = EditorGUI.indentLevel;

            EditorGUI.indentLevel = 0;

            position = DrawHeaderIfNeed(position, property);
            DrawLine(position, property, (slice, rect) => slice.Draw(rect));

            EditorGUI.indentLevel = indentLevel;
            Profiler.EndSample();
        }