示例#1
0
        private void DrawersGUI()
        {
            int count = RootValueDrawerCount;

            if (count == 0)
            {
                return;
            }

            var width = position.width;

            drawersGUIOptions[0] = GUILayout.MaxWidth(width);
            for (int i = 0; i < count; ++i)
            {
                var drawer = rootValueDrawers[i];
                drawer.GUI(null, drawersGUIOptions);

                // Draw separate line.
                if (i < count - 1)
                {
                    GUIEx.HorizontalLine(position.width);
                }
            }
        }
        private void LogEntriesGUI()
        {
            var evt     = Event.current;
            var evtType = evt.type;

            var options = GUILayoutOptions.Get(GUILayoutOptionType.MinHeight)
                          .SetValue(GUILayoutOptionType.MinHeight, 40);

            using (var scroll = new EditorGUILayout.ScrollViewScope(logEntriesScrollPosition, options))
            {
                using (new EditorGUILayout.VerticalScope())
                {
                    foreach (var entry in LogEntries)
                    {
                        bool selected = entry == SelectedLogEntry;
                        EditorGUILayout.LabelField(entry.Message, GetLogEntryStyle(selected));
                        var rect = GUILayoutUtility.GetLastRect();

                        int index = entry.Index;
                        if (evtType == EventType.MouseDown && rect.Contains(evt.mousePosition))
                        {
                            scheduledGUIActions.ScheduleAction(() => SelectedLogEntryIndex = index);
                            Repaint();
                        }
                    }
                }
                logEntriesScrollPosition = scroll.scrollPosition;
            }

            GUIEx.HorizontalLine(position.width);

            if (SelectedLogEntry != null)
            {
                SelectedLogEntry.StackTraceControl.GUI();
            }
        }