BeginVerticalSplit() public static method

public static BeginVerticalSplit ( SplitterState state ) : void
state SplitterState
return void
示例#1
0
        void LayoutWithStripsOnTop(List <AudioMixerGroupController> allGroups, Dictionary <AudioMixerEffectController, AudioMixerGroupController> effectMap)
        {
            // Do layouting
            SplitterState horizontalState = m_LayoutStripsOnTop.m_HorizontalSplitter;
            SplitterState verticalState   = m_LayoutStripsOnTop.m_VerticalSplitter;

            SplitterGUILayout.BeginVerticalSplit(verticalState, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
            if (m_GroupsRenderedAboveSections)
            {
                GUILayout.BeginVertical();
                GUILayout.EndVertical();
            }
            SplitterGUILayout.BeginHorizontalSplit(horizontalState, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
            if (!m_GroupsRenderedAboveSections)
            {
                GUILayout.BeginVertical();
                GUILayout.EndVertical();
            }
            SplitterGUILayout.EndHorizontalSplit();
            SplitterGUILayout.EndVerticalSplit();

            float channelStripYPos   = m_GroupsRenderedAboveSections ? EditorGUI.kWindowToolbarHeight : EditorGUI.kWindowToolbarHeight + verticalState.realSizes[0];
            float channelStripHeight = m_GroupsRenderedAboveSections ? verticalState.realSizes[0] : verticalState.realSizes[1];

            float sectionsYPos   = !m_GroupsRenderedAboveSections ? EditorGUI.kWindowToolbarHeight : EditorGUI.kWindowToolbarHeight + verticalState.realSizes[0];
            float sectionsHeight = !m_GroupsRenderedAboveSections ? verticalState.realSizes[0] : verticalState.realSizes[1];

            Rect channelStripViewRect = new Rect(0, channelStripYPos, position.width, channelStripHeight);
            Rect totalRectOfSections  = new Rect(0, channelStripViewRect.yMax, position.width, position.height - channelStripViewRect.height);

            // Rects for sections
            Rect[]      sectionRects    = new Rect[m_SectionOrder.Length];
            const float spaceFromBottom = 12f;

            for (int i = 0; i < sectionRects.Length; i++)
            {
                float xPos = (i > 0) ? sectionRects[i - 1].xMax : 0f;
                sectionRects[i] = new Rect(xPos, sectionsYPos, horizontalState.realSizes[i], sectionsHeight - spaceFromBottom);
            }

            // Spacing between lists
            const float halfSpaceBetween = 4f;

            sectionRects[0].x     += 2 * halfSpaceBetween;
            sectionRects[0].width -= 3 * halfSpaceBetween;
            sectionRects[sectionRects.Length - 1].x     += halfSpaceBetween;
            sectionRects[sectionRects.Length - 1].width -= 3 * halfSpaceBetween;
            for (int i = 1; i < sectionRects.Length - 1; i++)
            {
                sectionRects[i].x     += halfSpaceBetween;
                sectionRects[i].width -= halfSpaceBetween * 2;
            }

            // Do content
            DoSections(totalRectOfSections, sectionRects, m_SectionOrder);
            m_ChannelStripView.OnGUI(channelStripViewRect, m_ShowReferencedBuses, m_ShowBusConnections, m_ShowBusConnectionsOfSelection, allGroups, effectMap, m_SortGroupsAlphabetically, m_ShowDeveloperOverlays, m_GroupTree.ScrollToItem);

            // Horizontal line (split)
            EditorGUI.DrawRect(new Rect(0, EditorGUI.kWindowToolbarHeight + verticalState.realSizes[0] - 1, position.width, 1), new Color(0f, 0f, 0f, 0.4f));
        }
示例#2
0
 private void DrawSelectedInstructionDetails()
 {
     if (this.m_Instruction == null)
     {
         EditorGUILayout.BeginVertical(new GUILayoutOption[0]);
         GUILayout.FlexibleSpace();
         GUILayout.Label("Select a Instruction on the left to see details", s_Styles.centeredText, new GUILayoutOption[0]);
         GUILayout.FlexibleSpace();
         EditorGUILayout.EndVertical();
     }
     else
     {
         SplitterGUILayout.BeginVerticalSplit(this.m_InstructionDetailStacktraceSplitter, new GUILayoutOption[0]);
         this.m_InstructionDetailsScrollPos = EditorGUILayout.BeginScrollView(this.m_InstructionDetailsScrollPos, s_Styles.boxStyle, new GUILayoutOption[0]);
         EditorGUI.BeginDisabledGroup(true);
         this.DrawInspectedRect();
         EditorGUI.EndDisabledGroup();
         this.DrawInspectedStyle();
         EditorGUI.BeginDisabledGroup(true);
         this.DrawInspectedGUIContent();
         EditorGUI.EndDisabledGroup();
         EditorGUILayout.EndScrollView();
         this.DrawInspectedStacktrace();
         SplitterGUILayout.EndVerticalSplit();
     }
 }
 private void DrawSelectedInstructionDetails()
 {
     if (this.m_Instruction == null)
     {
         EditorGUILayout.BeginVertical(new GUILayoutOption[0]);
         GUILayout.FlexibleSpace();
         GUILayout.Label("Select a Instruction on the left to see details", GUIViewDebuggerWindow.s_Styles.centeredText, new GUILayoutOption[0]);
         GUILayout.FlexibleSpace();
         EditorGUILayout.EndVertical();
         return;
     }
     SplitterGUILayout.BeginVerticalSplit(this.m_InstructionDetailStacktraceSplitter, new GUILayoutOption[0]);
     this.m_InstructionDetailsScrollPos = EditorGUILayout.BeginScrollView(this.m_InstructionDetailsScrollPos, GUIViewDebuggerWindow.s_Styles.boxStyle, new GUILayoutOption[0]);
     using (new EditorGUI.DisabledScope(true))
     {
         this.DrawInspectedRect();
     }
     this.DrawInspectedStyle();
     using (new EditorGUI.DisabledScope(true))
     {
         this.DrawInspectedGUIContent();
     }
     EditorGUILayout.EndScrollView();
     this.DrawInspectedStacktrace();
     SplitterGUILayout.EndVerticalSplit();
 }
示例#4
0
        public virtual void DrawSelectedInstructionDetails(float availableWidth)
        {
            if (m_ListViewState.selectionChanged)
            {
                OnSelectedInstructionChanged(m_ListViewState.row);
            }
            else if (m_ListViewState.row >= GetInstructionCount())
            {
                OnSelectedInstructionChanged(-1);
            }

            if (!isInstructionSelected)
            {
                DoDrawNothingSelected();
                return;
            }

            SplitterGUILayout.BeginVerticalSplit(m_InstructionDetailStacktraceSplitter);

            m_InstructionDetailsScrollPos = EditorGUILayout.BeginScrollView(m_InstructionDetailsScrollPos, GUIViewDebuggerWindow.Styles.boxStyle);

            DoDrawSelectedInstructionDetails(m_ListViewState.row);
            EditorGUILayout.EndScrollView();

            DrawInspectedStacktrace(availableWidth);
            SplitterGUILayout.EndVerticalSplit();
        }
示例#5
0
        private void LayoutWithStripsOnTop(List <AudioMixerGroupController> allGroups, Dictionary <AudioMixerEffectController, AudioMixerGroupController> effectMap)
        {
            SplitterState horizontalSplitter = this.m_LayoutStripsOnTop.m_HorizontalSplitter;
            SplitterState verticalSplitter   = this.m_LayoutStripsOnTop.m_VerticalSplitter;

            SplitterGUILayout.BeginVerticalSplit(verticalSplitter, new GUILayoutOption[2]
            {
                GUILayout.ExpandWidth(true),
                GUILayout.ExpandHeight(true)
            });
            if (this.m_GroupsRenderedAboveSections)
            {
                GUILayout.BeginVertical();
                GUILayout.EndVertical();
            }
            SplitterGUILayout.BeginHorizontalSplit(horizontalSplitter, new GUILayoutOption[2]
            {
                GUILayout.ExpandWidth(true),
                GUILayout.ExpandHeight(true)
            });
            if (!this.m_GroupsRenderedAboveSections)
            {
                GUILayout.BeginVertical();
                GUILayout.EndVertical();
            }
            SplitterGUILayout.EndHorizontalSplit();
            SplitterGUILayout.EndVerticalSplit();
            float y1     = !this.m_GroupsRenderedAboveSections ? 17f + (float)verticalSplitter.realSizes[0] : 17f;
            float height = !this.m_GroupsRenderedAboveSections ? (float)verticalSplitter.realSizes[1] : (float)verticalSplitter.realSizes[0];
            float y2     = this.m_GroupsRenderedAboveSections ? 17f + (float)verticalSplitter.realSizes[0] : 17f;
            float num    = this.m_GroupsRenderedAboveSections ? (float)verticalSplitter.realSizes[1] : (float)verticalSplitter.realSizes[0];
            Rect  rect   = new Rect(0.0f, y1, this.position.width, height);
            Rect  totalRectOfSections = new Rect(0.0f, rect.yMax, this.position.width, this.position.height - rect.height);

            Rect[] sectionRects = new Rect[this.m_SectionOrder.Length];
            for (int index = 0; index < sectionRects.Length; ++index)
            {
                float x = index <= 0 ? 0.0f : sectionRects[index - 1].xMax;
                sectionRects[index] = new Rect(x, y2, (float)horizontalSplitter.realSizes[index], num - 12f);
            }
            sectionRects[0].x     += 8f;
            sectionRects[0].width -= 12f;
            sectionRects[sectionRects.Length - 1].x     += 4f;
            sectionRects[sectionRects.Length - 1].width -= 12f;
            for (int index = 1; index < sectionRects.Length - 1; ++index)
            {
                sectionRects[index].x     += 4f;
                sectionRects[index].width -= 8f;
            }
            this.DoSections(totalRectOfSections, sectionRects, this.m_SectionOrder);
            this.m_ChannelStripView.OnGUI(rect, this.m_ShowReferencedBuses, this.m_ShowBusConnections, this.m_ShowBusConnectionsOfSelection, allGroups, effectMap, this.m_SortGroupsAlphabetically, this.m_ShowDeveloperOverlays, this.m_GroupTree.ScrollToItem);
            EditorGUI.DrawRect(new Rect(0.0f, (float)(17.0 + (double)verticalSplitter.realSizes[0] - 1.0), this.position.width, 1f), new Color(0.0f, 0.0f, 0.0f, 0.4f));
        }
示例#6
0
 public virtual void DrawSelectedInstructionDetails()
 {
     if (this.m_ListViewState.selectionChanged)
     {
         this.OnSelectedInstructionChanged(this.m_ListViewState.row);
     }
     if (!this.HasSelectedinstruction())
     {
         this.DoDrawNothingSelected();
     }
     else
     {
         SplitterGUILayout.BeginVerticalSplit(this.m_InstructionDetailStacktraceSplitter, new GUILayoutOption[0]);
         this.m_InstructionDetailsScrollPos = EditorGUILayout.BeginScrollView(this.m_InstructionDetailsScrollPos, GUIViewDebuggerWindow.s_Styles.boxStyle, new GUILayoutOption[0]);
         this.DoDrawSelectedInstructionDetails(this.m_ListViewState.row);
         EditorGUILayout.EndScrollView();
         this.DrawInspectedStacktrace();
         SplitterGUILayout.EndVerticalSplit();
     }
 }
示例#7
0
        public void UpdateGUI()
        {
            SplitterGUILayout.BeginHorizontalSplit(this.horSplit, new GUILayoutOption[0]);
            GUILayout.BeginVertical(this.constants.box, new GUILayoutOption[0]);
            GUILayout.Label(this.totalUpdates, this.constants.title, new GUILayoutOption[0]);
            IEnumerator enumerator = ListViewGUILayout.ListView(this.lv, GUIStyle.none, new GUILayoutOption[0]).GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    ListViewElement current  = (ListViewElement)enumerator.Current;
                    Rect            position = current.position;
                    position.x++;
                    position.y++;
                    if (Event.current.type == EventType.Repaint)
                    {
                        if ((current.row % 2) == 0)
                        {
                            this.constants.entryEven.Draw(position, false, false, false, false);
                        }
                        else
                        {
                            this.constants.entryOdd.Draw(position, false, false, false, false);
                        }
                    }
                    GUILayout.BeginVertical((current.row != this.lv.row) ? this.constants.entryNormal : this.constants.entrySelected, new GUILayoutOption[0]);
                    GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.MinWidth(50f) };
                    GUILayout.Label(this.messageFirstLines[current.row], this.constants.serverUpdateLog, options);
                    GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                    GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.MinWidth(100f) };
                    GUILayout.Label(this.changesets[current.row].changeset.ToString() + " " + this.changesets[current.row].date, this.constants.serverUpdateInfo, optionArray2);
                    GUILayoutOption[] optionArray3 = new GUILayoutOption[] { GUILayout.Width((float)this.maxNickLength) };
                    GUILayout.Label(this.changesets[current.row].owner, this.constants.serverUpdateInfo, optionArray3);
                    GUILayout.EndHorizontal();
                    GUILayout.EndVertical();
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
            if (this.lv.selectionChanged)
            {
                this.SetSelectedRevisionLine(this.lv.row);
            }
            GUILayout.EndVertical();
            SplitterGUILayout.BeginVerticalSplit(this.vertSplit, new GUILayoutOption[0]);
            GUILayout.BeginVertical(this.constants.box, new GUILayoutOption[0]);
            GUILayout.Label("Changeset", this.constants.title, new GUILayoutOption[0]);
            int         num         = -1;
            int         file        = -1;
            IEnumerator enumerator2 = ListViewGUILayout.ListView(this.pv.lv, GUIStyle.none, new GUILayoutOption[0]).GetEnumerator();

            try
            {
                while (enumerator2.MoveNext())
                {
                    ChangeFlags     changeFlags;
                    ListViewElement element2 = (ListViewElement)enumerator2.Current;
                    if ((num == -1) && !this.pv.IndexToFolderAndFile(element2.row, ref num, ref file))
                    {
                        return;
                    }
                    ParentViewFolder folder = this.pv.folders[num];
                    if (ListViewGUILayout.HasMouseDown(element2.position))
                    {
                        if (Event.current.clickCount == 2)
                        {
                            if (!this.isDirSelected && (this.selectedGUID != string.Empty))
                            {
                                this.DoShowDiff(false);
                                GUIUtility.ExitGUI();
                            }
                        }
                        else
                        {
                            this.pv.lv.scrollPos = ListViewShared.ListViewScrollToRow(this.pv.lv.ilvState, element2.row);
                            this.DoSelect(num, file, element2.row);
                        }
                    }
                    else if (ListViewGUILayout.HasMouseDown(element2.position, 1))
                    {
                        if (this.lv.row != element2.row)
                        {
                            this.DoSelect(num, file, element2.row);
                        }
                        if (!this.isDirSelected && (this.selectedGUID != string.Empty))
                        {
                            GUIUtility.hotControl = 0;
                            Rect rect2 = new Rect(Event.current.mousePosition.x, Event.current.mousePosition.y, 1f, 1f);
                            EditorUtility.DisplayCustomMenu(rect2, this.dropDownMenuItems, null, new EditorUtility.SelectMenuItemFunction(this.ContextMenuClick), null);
                            Event.current.Use();
                        }
                    }
                    if ((element2.row == this.pv.lv.row) && (Event.current.type == EventType.Repaint))
                    {
                        this.constants.entrySelected.Draw(element2.position, false, false, false, false);
                    }
                    if (file != -1)
                    {
                        Texture2D cachedIcon = AssetDatabase.GetCachedIcon(folder.name + "/" + folder.files[file].name) as Texture2D;
                        if (cachedIcon == null)
                        {
                            cachedIcon = InternalEditorUtility.GetIconForFile(folder.files[file].name);
                        }
                        GUILayout.Label(new GUIContent(folder.files[file].name, cachedIcon), this.constants.element, new GUILayoutOption[0]);
                        changeFlags = folder.files[file].changeFlags;
                    }
                    else
                    {
                        GUILayout.Label(folder.name, this.constants.header, new GUILayoutOption[0]);
                        changeFlags = folder.changeFlags;
                    }
                    GUIContent badgeNew = null;
                    if (this.HasFlag(changeFlags, ChangeFlags.Undeleted) || this.HasFlag(changeFlags, ChangeFlags.Created))
                    {
                        badgeNew = ASMainWindow.constants.badgeNew;
                    }
                    else if (this.HasFlag(changeFlags, ChangeFlags.Deleted))
                    {
                        badgeNew = ASMainWindow.constants.badgeDelete;
                    }
                    else if (this.HasFlag(changeFlags, ChangeFlags.Renamed) || this.HasFlag(changeFlags, ChangeFlags.Moved))
                    {
                        badgeNew = ASMainWindow.constants.badgeMove;
                    }
                    if ((badgeNew != null) && (Event.current.type == EventType.Repaint))
                    {
                        Rect rect3 = new Rect(((element2.position.x + element2.position.width) - badgeNew.image.width) - 5f, (element2.position.y + (element2.position.height / 2f)) - (badgeNew.image.height / 2), (float)badgeNew.image.width, (float)badgeNew.image.height);
                        EditorGUIUtility.SetIconSize(Vector2.zero);
                        GUIStyle.none.Draw(rect3, badgeNew, false, false, false, false);
                        EditorGUIUtility.SetIconSize(this.iconSize);
                    }
                    this.pv.NextFileFolder(ref num, ref file);
                }
            }
            finally
            {
                IDisposable disposable2 = enumerator2 as IDisposable;
                if (disposable2 != null)
                {
                    disposable2.Dispose();
                }
            }
            if (this.pv.lv.selectionChanged && (this.selectedGUID != string.Empty))
            {
                if (this.selectedGUID != AssetServer.GetRootGUID())
                {
                    AssetServer.SetSelectionFromGUID(this.selectedGUID);
                }
                else
                {
                    AssetServer.SetSelectionFromGUID(string.Empty);
                }
            }
            if ((GUIUtility.keyboardControl == this.pv.lv.ID) && (((Event.current.type == EventType.KeyDown) && (Event.current.keyCode == KeyCode.Return)) && (!this.isDirSelected && (this.selectedGUID != string.Empty))))
            {
                this.DoShowDiff(false);
                GUIUtility.ExitGUI();
            }
            GUILayout.EndVertical();
            GUILayout.BeginVertical(this.constants.box, new GUILayoutOption[0]);
            GUILayout.Label("Update Message", this.constants.title, new GUILayoutOption[0]);
            GUILayout.TextArea((this.lv.row < 0) ? "" : this.changesets[this.lv.row].message, this.constants.wwText, new GUILayoutOption[0]);
            GUILayout.EndVertical();
            SplitterGUILayout.EndVerticalSplit();
            SplitterGUILayout.EndHorizontalSplit();
        }
示例#8
0
        private void OnGUI()
        {
            Event current = Event.current;

            ConsoleWindow.LoadIcons();
            GUILayout.BeginHorizontal(ConsoleWindow.Constants.Toolbar, new GUILayoutOption[0]);
            if (GUILayout.Button("Clear", ConsoleWindow.Constants.MiniButton, new GUILayoutOption[0]))
            {
                LogEntries.Clear();
                GUIUtility.keyboardControl = 0;
            }
            int count = LogEntries.GetCount();

            if (this.m_ListView.totalRows != count && this.m_ListView.scrollPos.y >= (float)(this.m_ListView.rowHeight * this.m_ListView.totalRows - this.ms_LVHeight))
            {
                this.m_ListView.scrollPos.y = (float)(count * 32 - this.ms_LVHeight);
            }
            EditorGUILayout.Space();
            bool flag = this.HasFlag(ConsoleWindow.ConsoleFlags.Collapse);

            this.SetFlag(ConsoleWindow.ConsoleFlags.Collapse, GUILayout.Toggle(flag, "Collapse", ConsoleWindow.Constants.MiniButtonLeft, new GUILayoutOption[0]));
            bool flag2 = flag != this.HasFlag(ConsoleWindow.ConsoleFlags.Collapse);

            if (flag2)
            {
                this.m_ListView.row         = -1;
                this.m_ListView.scrollPos.y = (float)(LogEntries.GetCount() * 32);
            }
            this.SetFlag(ConsoleWindow.ConsoleFlags.ClearOnPlay, GUILayout.Toggle(this.HasFlag(ConsoleWindow.ConsoleFlags.ClearOnPlay), "Clear on Play", ConsoleWindow.Constants.MiniButtonMiddle, new GUILayoutOption[0]));
            this.SetFlag(ConsoleWindow.ConsoleFlags.ErrorPause, GUILayout.Toggle(this.HasFlag(ConsoleWindow.ConsoleFlags.ErrorPause), "Error Pause", ConsoleWindow.Constants.MiniButtonRight, new GUILayoutOption[0]));
            EditorGUILayout.Space();
            if (this.m_DevBuild)
            {
                GUILayout.FlexibleSpace();
                this.SetFlag(ConsoleWindow.ConsoleFlags.StopForAssert, GUILayout.Toggle(this.HasFlag(ConsoleWindow.ConsoleFlags.StopForAssert), "Stop for Assert", ConsoleWindow.Constants.MiniButtonLeft, new GUILayoutOption[0]));
                this.SetFlag(ConsoleWindow.ConsoleFlags.StopForError, GUILayout.Toggle(this.HasFlag(ConsoleWindow.ConsoleFlags.StopForError), "Stop for Error", ConsoleWindow.Constants.MiniButtonRight, new GUILayoutOption[0]));
            }
            GUILayout.FlexibleSpace();
            int num  = 0;
            int num2 = 0;
            int num3 = 0;

            LogEntries.GetCountsByType(ref num, ref num2, ref num3);
            bool val  = GUILayout.Toggle(this.HasFlag(ConsoleWindow.ConsoleFlags.LogLevelLog), new GUIContent((num3 > 999) ? "999+" : num3.ToString(), (num3 <= 0) ? ConsoleWindow.iconInfoMono : ConsoleWindow.iconInfoSmall), ConsoleWindow.Constants.MiniButtonRight, new GUILayoutOption[0]);
            bool val2 = GUILayout.Toggle(this.HasFlag(ConsoleWindow.ConsoleFlags.LogLevelWarning), new GUIContent((num2 > 999) ? "999+" : num2.ToString(), (num2 <= 0) ? ConsoleWindow.iconWarnMono : ConsoleWindow.iconWarnSmall), ConsoleWindow.Constants.MiniButtonMiddle, new GUILayoutOption[0]);
            bool val3 = GUILayout.Toggle(this.HasFlag(ConsoleWindow.ConsoleFlags.LogLevelError), new GUIContent((num > 999) ? "999+" : num.ToString(), (num <= 0) ? ConsoleWindow.iconErrorMono : ConsoleWindow.iconErrorSmall), ConsoleWindow.Constants.MiniButtonLeft, new GUILayoutOption[0]);

            this.SetFlag(ConsoleWindow.ConsoleFlags.LogLevelLog, val);
            this.SetFlag(ConsoleWindow.ConsoleFlags.LogLevelWarning, val2);
            this.SetFlag(ConsoleWindow.ConsoleFlags.LogLevelError, val3);
            GUILayout.EndHorizontal();
            this.m_ListView.totalRows = LogEntries.StartGettingEntries();
            SplitterGUILayout.BeginVerticalSplit(this.spl, new GUILayoutOption[0]);
            EditorGUIUtility.SetIconSize(new Vector2(32f, 32f));
            GUIContent gUIContent = new GUIContent();
            int        controlID  = GUIUtility.GetControlID(FocusType.Native);

            try
            {
                bool flag3 = false;
                bool flag4 = this.HasFlag(ConsoleWindow.ConsoleFlags.Collapse);
                foreach (ListViewElement listViewElement in ListViewGUI.ListView(this.m_ListView, ConsoleWindow.Constants.Box, new GUILayoutOption[0]))
                {
                    if (current.type == EventType.MouseDown && current.button == 0 && listViewElement.position.Contains(current.mousePosition))
                    {
                        if (current.clickCount == 2)
                        {
                            LogEntries.RowGotDoubleClicked(this.m_ListView.row);
                        }
                        flag3 = true;
                    }
                    if (current.type == EventType.Repaint)
                    {
                        int    mode = 0;
                        string text = null;
                        LogEntries.GetFirstTwoLinesEntryTextAndModeInternal(listViewElement.row, ref mode, ref text);
                        GUIStyle gUIStyle = (listViewElement.row % 2 != 0) ? ConsoleWindow.Constants.EvenBackground : ConsoleWindow.Constants.OddBackground;
                        gUIStyle.Draw(listViewElement.position, false, false, this.m_ListView.row == listViewElement.row, false);
                        gUIContent.text = text;
                        GUIStyle styleForErrorMode = ConsoleWindow.GetStyleForErrorMode(mode);
                        styleForErrorMode.Draw(listViewElement.position, gUIContent, controlID, this.m_ListView.row == listViewElement.row);
                        if (flag4)
                        {
                            Rect position = listViewElement.position;
                            gUIContent.text = LogEntries.GetEntryCount(listViewElement.row).ToString(CultureInfo.InvariantCulture);
                            Vector2 vector = ConsoleWindow.Constants.CountBadge.CalcSize(gUIContent);
                            position.xMin  = position.xMax - vector.x;
                            position.yMin += (position.yMax - position.yMin - vector.y) * 0.5f;
                            position.x    -= 5f;
                            GUI.Label(position, gUIContent, ConsoleWindow.Constants.CountBadge);
                        }
                    }
                }
                if (flag3 && this.m_ListView.scrollPos.y >= (float)(this.m_ListView.rowHeight * this.m_ListView.totalRows - this.ms_LVHeight))
                {
                    this.m_ListView.scrollPos.y = (float)(this.m_ListView.rowHeight * this.m_ListView.totalRows - this.ms_LVHeight - 1);
                }
                if (this.m_ListView.totalRows == 0 || this.m_ListView.row >= this.m_ListView.totalRows || this.m_ListView.row < 0)
                {
                    if (this.m_ActiveText.Length != 0)
                    {
                        this.SetActiveEntry(null);
                    }
                }
                else
                {
                    LogEntry logEntry = new LogEntry();
                    LogEntries.GetEntryInternal(this.m_ListView.row, logEntry);
                    this.SetActiveEntry(logEntry);
                    LogEntries.GetEntryInternal(this.m_ListView.row, logEntry);
                    if (this.m_ListView.selectionChanged || !this.m_ActiveText.Equals(logEntry.condition))
                    {
                        this.SetActiveEntry(logEntry);
                    }
                }
                if (GUIUtility.keyboardControl == this.m_ListView.ID && current.type == EventType.KeyDown && current.keyCode == KeyCode.Return && this.m_ListView.row != 0)
                {
                    LogEntries.RowGotDoubleClicked(this.m_ListView.row);
                    Event.current.Use();
                }
                if (current.type != EventType.Layout && ListViewGUI.ilvState.rectHeight != 1)
                {
                    this.ms_LVHeight = ListViewGUI.ilvState.rectHeight;
                }
            }
            finally
            {
                LogEntries.EndGettingEntries();
                EditorGUIUtility.SetIconSize(Vector2.zero);
            }
            this.m_TextScroll = GUILayout.BeginScrollView(this.m_TextScroll, ConsoleWindow.Constants.Box);
            float minHeight = ConsoleWindow.Constants.MessageStyle.CalcHeight(GUIContent.Temp(this.m_ActiveText), base.position.width);

            EditorGUILayout.SelectableLabel(this.m_ActiveText, ConsoleWindow.Constants.MessageStyle, new GUILayoutOption[]
            {
                GUILayout.ExpandWidth(true),
                GUILayout.ExpandHeight(true),
                GUILayout.MinHeight(minHeight)
            });
            GUILayout.EndScrollView();
            SplitterGUILayout.EndVerticalSplit();
            if ((current.type == EventType.ValidateCommand || current.type == EventType.ExecuteCommand) && current.commandName == "Copy" && this.m_ActiveText != string.Empty)
            {
                if (current.type == EventType.ExecuteCommand)
                {
                    EditorGUIUtility.systemCopyBuffer = this.m_ActiveText;
                }
                current.Use();
            }
        }
        private void LayoutWithStripsOnTop(List <AudioMixerGroupController> allGroups, Dictionary <AudioMixerEffectController, AudioMixerGroupController> effectMap)
        {
            SplitterState horizontalSplitter = this.m_LayoutStripsOnTop.m_HorizontalSplitter;
            SplitterState verticalSplitter   = this.m_LayoutStripsOnTop.m_VerticalSplitter;

            SplitterGUILayout.BeginVerticalSplit(verticalSplitter, new GUILayoutOption[]
            {
                GUILayout.ExpandWidth(true),
                GUILayout.ExpandHeight(true)
            });
            if (this.m_GroupsRenderedAboveSections)
            {
                GUILayout.BeginVertical(new GUILayoutOption[0]);
                GUILayout.EndVertical();
            }
            SplitterGUILayout.BeginHorizontalSplit(horizontalSplitter, new GUILayoutOption[]
            {
                GUILayout.ExpandWidth(true),
                GUILayout.ExpandHeight(true)
            });
            if (!this.m_GroupsRenderedAboveSections)
            {
                GUILayout.BeginVertical(new GUILayoutOption[0]);
                GUILayout.EndVertical();
            }
            SplitterGUILayout.EndHorizontalSplit();
            SplitterGUILayout.EndVerticalSplit();
            float y      = (float)((!this.m_GroupsRenderedAboveSections) ? (17 + verticalSplitter.realSizes[0]) : 17);
            float height = (float)((!this.m_GroupsRenderedAboveSections) ? verticalSplitter.realSizes[1] : verticalSplitter.realSizes[0]);
            float y2     = (float)(this.m_GroupsRenderedAboveSections ? (17 + verticalSplitter.realSizes[0]) : 17);
            float num    = (float)(this.m_GroupsRenderedAboveSections ? verticalSplitter.realSizes[1] : verticalSplitter.realSizes[0]);
            Rect  rect   = new Rect(0f, y, base.position.width, height);
            Rect  totalRectOfSections = new Rect(0f, rect.yMax, base.position.width, base.position.height - rect.height);

            Rect[] array = new Rect[this.m_SectionOrder.Length];
            for (int i = 0; i < array.Length; i++)
            {
                float x = (i <= 0) ? 0f : array[i - 1].xMax;
                array[i] = new Rect(x, y2, (float)horizontalSplitter.realSizes[i], num - 12f);
            }
            Rect[] expr_1F2_cp_0 = array;
            int    expr_1F2_cp_1 = 0;

            expr_1F2_cp_0[expr_1F2_cp_1].x = expr_1F2_cp_0[expr_1F2_cp_1].x + 8f;
            Rect[] expr_20B_cp_0 = array;
            int    expr_20B_cp_1 = 0;

            expr_20B_cp_0[expr_20B_cp_1].width = expr_20B_cp_0[expr_20B_cp_1].width - 12f;
            Rect[] expr_229_cp_0 = array;
            int    expr_229_cp_1 = array.Length - 1;

            expr_229_cp_0[expr_229_cp_1].x = expr_229_cp_0[expr_229_cp_1].x + 4f;
            Rect[] expr_247_cp_0 = array;
            int    expr_247_cp_1 = array.Length - 1;

            expr_247_cp_0[expr_247_cp_1].width = expr_247_cp_0[expr_247_cp_1].width - 12f;
            for (int j = 1; j < array.Length - 1; j++)
            {
                Rect[] expr_26A_cp_0 = array;
                int    expr_26A_cp_1 = j;
                expr_26A_cp_0[expr_26A_cp_1].x = expr_26A_cp_0[expr_26A_cp_1].x + 4f;
                Rect[] expr_284_cp_0 = array;
                int    expr_284_cp_1 = j;
                expr_284_cp_0[expr_284_cp_1].width = expr_284_cp_0[expr_284_cp_1].width - 8f;
            }
            this.DoSections(totalRectOfSections, array, this.m_SectionOrder);
            this.m_ChannelStripView.OnGUI(rect, this.m_ShowReferencedBuses, this.m_ShowBusConnections, this.m_ShowBusConnectionsOfSelection, allGroups, effectMap, this.m_SortGroupsAlphabetically, this.m_ShowDeveloperOverlays, this.m_GroupTree.ScrollToItem);
            EditorGUI.DrawRect(new Rect(0f, (float)(17 + verticalSplitter.realSizes[0] - 1), base.position.width, 1f), new Color(0f, 0f, 0f, 0.4f));
        }
示例#10
0
        internal void OnGUI()
        {
            Event e = Event.current;

            LoadIcons();

            if (!m_HasUpdatedGuiStyles)
            {
                m_LineHeight   = Mathf.RoundToInt(Constants.ErrorStyle.lineHeight);
                m_BorderHeight = Constants.ErrorStyle.border.top + Constants.ErrorStyle.border.bottom;
                UpdateListView();
            }

            GUILayout.BeginHorizontal(Constants.Toolbar);

            // Clear button and clearing options
            bool clearClicked = false;

            if (EditorGUILayout.DropDownToggle(ref clearClicked, Constants.Clear, EditorStyles.toolbarDropDownToggle))
            {
                var clearOnPlay  = HasFlag(ConsoleFlags.ClearOnPlay);
                var clearOnBuild = HasFlag(ConsoleFlags.ClearOnBuild);

                GenericMenu menu = new GenericMenu();
                menu.AddItem(Constants.ClearOnPlay, clearOnPlay, () => { SetFlag(ConsoleFlags.ClearOnPlay, !clearOnPlay); });
                menu.AddItem(Constants.ClearOnBuild, clearOnBuild, () => { SetFlag(ConsoleFlags.ClearOnBuild, !clearOnBuild); });
                var rect = GUILayoutUtility.GetLastRect();
                rect.y += EditorGUIUtility.singleLineHeight;
                menu.DropDown(rect);
            }
            if (clearClicked)
            {
                LogEntries.Clear();
                GUIUtility.keyboardControl = 0;
            }

            int currCount = LogEntries.GetCount();

            if (m_ListView.totalRows != currCount)
            {
                // scroll bar was at the bottom?
                if (m_ListView.scrollPos.y >= m_ListView.rowHeight * m_ListView.totalRows - ms_LVHeight)
                {
                    m_ListView.scrollPos.y = currCount * RowHeight - ms_LVHeight;
                }
            }

            bool wasCollapsed = HasFlag(ConsoleFlags.Collapse);

            SetFlag(ConsoleFlags.Collapse, GUILayout.Toggle(wasCollapsed, Constants.Collapse, Constants.MiniButton));

            bool collapsedChanged = (wasCollapsed != HasFlag(ConsoleFlags.Collapse));

            if (collapsedChanged)
            {
                // unselect if collapsed flag changed
                m_ListView.row = -1;

                // scroll to bottom
                m_ListView.scrollPos.y = LogEntries.GetCount() * RowHeight;
            }

            if (HasSpaceForExtraButtons())
            {
                SetFlag(ConsoleFlags.ErrorPause, GUILayout.Toggle(HasFlag(ConsoleFlags.ErrorPause), Constants.ErrorPause, Constants.MiniButton));
                PlayerConnectionGUILayout.ConnectionTargetSelectionDropdown(m_ConsoleAttachToPlayerState, EditorStyles.toolbarDropDown);
            }

            GUILayout.FlexibleSpace();

            // Search bar
            if (HasSpaceForExtraButtons())
            {
                SearchField(e);
            }

            // Flags
            int errorCount = 0, warningCount = 0, logCount = 0;

            LogEntries.GetCountsByType(ref errorCount, ref warningCount, ref logCount);
            EditorGUI.BeginChangeCheck();
            bool setLogFlag     = GUILayout.Toggle(HasFlag(ConsoleFlags.LogLevelLog), new GUIContent((logCount <= 999 ? logCount.ToString() : "999+"), logCount > 0 ? iconInfoSmall : iconInfoMono), Constants.MiniButton);
            bool setWarningFlag = GUILayout.Toggle(HasFlag(ConsoleFlags.LogLevelWarning), new GUIContent((warningCount <= 999 ? warningCount.ToString() : "999+"), warningCount > 0 ? iconWarnSmall : iconWarnMono), Constants.MiniButton);
            bool setErrorFlag   = GUILayout.Toggle(HasFlag(ConsoleFlags.LogLevelError), new GUIContent((errorCount <= 999 ? errorCount.ToString() : "999+"), errorCount > 0 ? iconErrorSmall : iconErrorMono), Constants.MiniButtonRight);

            // Active entry index may no longer be valid
            if (EditorGUI.EndChangeCheck())
            {
                SetActiveEntry(null);
            }

            SetFlag(ConsoleFlags.LogLevelLog, setLogFlag);
            SetFlag(ConsoleFlags.LogLevelWarning, setWarningFlag);
            SetFlag(ConsoleFlags.LogLevelError, setErrorFlag);

            GUILayout.EndHorizontal();

            // Console entries
            SplitterGUILayout.BeginVerticalSplit(spl);

            GUIContent tempContent      = new GUIContent();
            int        id               = GUIUtility.GetControlID(0);
            int        rowDoubleClicked = -1;

            /////@TODO: Make Frame selected work with ListViewState
            using (new GettingLogEntriesScope(m_ListView))
            {
                int  selectedRow      = -1;
                bool openSelectedItem = false;
                bool collapsed        = HasFlag(ConsoleFlags.Collapse);
                foreach (ListViewElement el in ListViewGUI.ListView(m_ListView, ListViewOptions.wantsRowMultiSelection, Constants.Box))
                {
                    if (e.type == EventType.MouseDown && e.button == 0 && el.position.Contains(e.mousePosition))
                    {
                        selectedRow = m_ListView.row;
                        if (e.clickCount == 2)
                        {
                            openSelectedItem = true;
                        }
                    }
                    else if (e.type == EventType.Repaint)
                    {
                        int    mode = 0;
                        string text = null;
                        LogEntries.GetLinesAndModeFromEntryInternal(el.row, Constants.LogStyleLineCount, ref mode, ref text);
                        bool entryIsSelected = m_ListView.selectedItems != null && el.row < m_ListView.selectedItems.Length && m_ListView.selectedItems[el.row];

                        // offset value in x for icon and text
                        var offset = Constants.LogStyleLineCount == 1 ? 4 : 8;

                        // Draw the background
                        GUIStyle s = el.row % 2 == 0 ? Constants.OddBackground : Constants.EvenBackground;
                        s.Draw(el.position, false, false, entryIsSelected, false);

                        // Draw the icon
                        GUIStyle iconStyle = GetStyleForErrorMode(mode, true, Constants.LogStyleLineCount == 1);
                        Rect     iconRect  = el.position;
                        iconRect.x += offset;
                        iconRect.y += 2;

                        iconStyle.Draw(iconRect, false, false, entryIsSelected, false);

                        // Draw the text
                        tempContent.text = text;
                        GUIStyle errorModeStyle =
                            GetStyleForErrorMode(mode, false, Constants.LogStyleLineCount == 1);
                        var textRect = el.position;
                        textRect.x += offset;

                        if (string.IsNullOrEmpty(m_SearchText))
                        {
                            errorModeStyle.Draw(textRect, tempContent, id, m_ListView.row == el.row);
                        }
                        else
                        {
                            //the whole text contains the searchtext, we have to know where it is
                            int startIndex = text.IndexOf(m_SearchText, StringComparison.OrdinalIgnoreCase);
                            if (startIndex == -1) // the searchtext is not in the visible text, we don't show the selection
                            {
                                errorModeStyle.Draw(textRect, tempContent, id, m_ListView.row == el.row);
                            }
                            else // the searchtext is visible, we show the selection
                            {
                                int endIndex = startIndex + m_SearchText.Length;

                                const bool isActive          = false;
                                const bool hasKeyboardFocus  = true; // This ensure we draw the selection text over the label.
                                const bool drawAsComposition = false;
                                Color      selectionColor    = GUI.skin.settings.selectionColor;

                                errorModeStyle.DrawWithTextSelection(textRect, tempContent, isActive, hasKeyboardFocus, startIndex, endIndex, drawAsComposition, selectionColor);
                            }
                        }

                        if (collapsed)
                        {
                            Rect badgeRect = el.position;
                            tempContent.text = LogEntries.GetEntryCount(el.row)
                                               .ToString(CultureInfo.InvariantCulture);
                            Vector2 badgeSize = Constants.CountBadge.CalcSize(tempContent);

                            if (Constants.CountBadge.fixedHeight > 0)
                            {
                                badgeSize.y = Constants.CountBadge.fixedHeight;
                            }
                            badgeRect.xMin  = badgeRect.xMax - badgeSize.x;
                            badgeRect.yMin += ((badgeRect.yMax - badgeRect.yMin) - badgeSize.y) * 0.5f;
                            badgeRect.x    -= 5f;
                            GUI.Label(badgeRect, tempContent, Constants.CountBadge);
                        }
                    }
                }

                if (selectedRow != -1)
                {
                    if (m_ListView.scrollPos.y >= m_ListView.rowHeight * m_ListView.totalRows - ms_LVHeight)
                    {
                        m_ListView.scrollPos.y = m_ListView.rowHeight * m_ListView.totalRows - ms_LVHeight - 1;
                    }
                }

                // Make sure the selected entry is up to date
                if (m_ListView.totalRows == 0 || m_ListView.row >= m_ListView.totalRows || m_ListView.row < 0)
                {
                    if (m_ActiveText.Length != 0)
                    {
                        SetActiveEntry(null);
                    }
                }
                else
                {
                    LogEntry entry = new LogEntry();
                    LogEntries.GetEntryInternal(m_ListView.row, entry);
                    SetActiveEntry(entry);

                    // see if selected entry changed. if so - clear additional info
                    LogEntries.GetEntryInternal(m_ListView.row, entry);
                    if (m_ListView.selectionChanged || !m_ActiveText.Equals(entry.message))
                    {
                        SetActiveEntry(entry);
                    }

                    // If copy, get the messages from selected rows
                    if (e.type == EventType.ExecuteCommand && e.commandName == EventCommandNames.Copy && m_ListView.selectedItems != null)
                    {
                        m_CopyString.Clear();
                        for (int rowIndex = 0; rowIndex < m_ListView.selectedItems.Length; rowIndex++)
                        {
                            if (m_ListView.selectedItems[rowIndex])
                            {
                                LogEntries.GetEntryInternal(rowIndex, entry);
                                m_CopyString.AppendLine(entry.message);
                            }
                        }
                    }
                }
                // Open entry using return key
                if ((GUIUtility.keyboardControl == m_ListView.ID) && (e.type == EventType.KeyDown) &&
                    (e.keyCode == KeyCode.Return) && (m_ListView.row != 0))
                {
                    selectedRow      = m_ListView.row;
                    openSelectedItem = true;
                }

                if (e.type != EventType.Layout && ListViewGUI.ilvState.rectHeight != 1)
                {
                    ms_LVHeight = ListViewGUI.ilvState.rectHeight;
                }

                if (openSelectedItem)
                {
                    rowDoubleClicked = selectedRow;
                    e.Use();
                }
            }

            // Prevent dead locking in EditorMonoConsole by delaying callbacks (which can log to the console) until after LogEntries.EndGettingEntries() has been
            // called (this releases the mutex in EditorMonoConsole so logging again is allowed). Fix for case 1081060.
            if (rowDoubleClicked != -1)
            {
                LogEntries.RowGotDoubleClicked(rowDoubleClicked);
            }


            // Display active text (We want word wrapped text with a vertical scrollbar)
            m_TextScroll = GUILayout.BeginScrollView(m_TextScroll, Constants.Box);

            string stackWithHyperlinks = StacktraceWithHyperlinks(m_ActiveText);
            float  height = Constants.MessageStyle.CalcHeight(GUIContent.Temp(stackWithHyperlinks), position.width);

            EditorGUILayout.SelectableLabel(stackWithHyperlinks, Constants.MessageStyle, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true), GUILayout.MinHeight(height + 10));

            GUILayout.EndScrollView();

            SplitterGUILayout.EndVerticalSplit();

            // Copy & Paste selected item
            if ((e.type == EventType.ValidateCommand || e.type == EventType.ExecuteCommand) && e.commandName == EventCommandNames.Copy && m_CopyString != null)
            {
                if (e.type == EventType.ExecuteCommand)
                {
                    EditorGUIUtility.systemCopyBuffer = m_CopyString.ToString();
                }
                e.Use();
            }
        }
        void OnGUI()
        {
            Event e = Event.current;

            LoadIcons();

            if (!m_HasUpdatedGuiStyles)
            {
                m_LineHeight   = Mathf.RoundToInt(Constants.ErrorStyle.lineHeight);
                m_BorderHeight = Constants.ErrorStyle.border.top + Constants.ErrorStyle.border.bottom;
                UpdateListView();
            }

            GUILayout.BeginHorizontal(Constants.Toolbar);

            if (GUILayout.Button(Constants.ClearLabel, Constants.MiniButton))
            {
                LogEntries.Clear();
                GUIUtility.keyboardControl = 0;
            }

            int currCount = LogEntries.GetCount();

            if (m_ListView.totalRows != currCount && m_ListView.totalRows > 0)
            {
                // scroll bar was at the bottom?
                if (m_ListView.scrollPos.y >= m_ListView.rowHeight * m_ListView.totalRows - ms_LVHeight)
                {
                    m_ListView.scrollPos.y = currCount * RowHeight - ms_LVHeight;
                }
            }

            EditorGUILayout.Space();

            bool wasCollapsed = HasFlag(ConsoleFlags.Collapse);

            SetFlag(ConsoleFlags.Collapse, GUILayout.Toggle(wasCollapsed, Constants.CollapseLabel, Constants.MiniButton));

            bool collapsedChanged = (wasCollapsed != HasFlag(ConsoleFlags.Collapse));

            if (collapsedChanged)
            {
                // unselect if collapsed flag changed
                m_ListView.row = -1;

                // scroll to bottom
                m_ListView.scrollPos.y = LogEntries.GetCount() * RowHeight;
            }

            SetFlag(ConsoleFlags.ClearOnPlay, GUILayout.Toggle(HasFlag(ConsoleFlags.ClearOnPlay), Constants.ClearOnPlayLabel, Constants.MiniButton));
            SetFlag(ConsoleFlags.ErrorPause, GUILayout.Toggle(HasFlag(ConsoleFlags.ErrorPause), Constants.ErrorPauseLabel, Constants.MiniButton));

            ConnectionGUILayout.AttachToPlayerDropdown(m_ConsoleAttachToPlayerState, EditorStyles.toolbarDropDown);

            EditorGUILayout.Space();

            if (m_DevBuild)
            {
                GUILayout.FlexibleSpace();
                SetFlag(ConsoleFlags.StopForAssert, GUILayout.Toggle(HasFlag(ConsoleFlags.StopForAssert), Constants.StopForAssertLabel, Constants.MiniButton));
                SetFlag(ConsoleFlags.StopForError, GUILayout.Toggle(HasFlag(ConsoleFlags.StopForError), Constants.StopForErrorLabel, Constants.MiniButton));
            }

            GUILayout.FlexibleSpace();

            int errorCount = 0, warningCount = 0, logCount = 0;

            LogEntries.GetCountsByType(ref errorCount, ref warningCount, ref logCount);
            EditorGUI.BeginChangeCheck();
            bool setLogFlag     = GUILayout.Toggle(HasFlag(ConsoleFlags.LogLevelLog), new GUIContent((logCount <= 999 ? logCount.ToString() : "999+"), logCount > 0 ? iconInfoSmall : iconInfoMono), Constants.MiniButton);
            bool setWarningFlag = GUILayout.Toggle(HasFlag(ConsoleFlags.LogLevelWarning), new GUIContent((warningCount <= 999 ? warningCount.ToString() : "999+"), warningCount > 0 ? iconWarnSmall : iconWarnMono), Constants.MiniButton);
            bool setErrorFlag   = GUILayout.Toggle(HasFlag(ConsoleFlags.LogLevelError), new GUIContent((errorCount <= 999 ? errorCount.ToString() : "999+"), errorCount > 0 ? iconErrorSmall : iconErrorMono), Constants.MiniButton);

            // Active entry index may no longer be valid
            if (EditorGUI.EndChangeCheck())
            {
                SetActiveEntry(null);
            }

            SetFlag(ConsoleFlags.LogLevelLog, setLogFlag);
            SetFlag(ConsoleFlags.LogLevelWarning, setWarningFlag);
            SetFlag(ConsoleFlags.LogLevelError, setErrorFlag);

            GUILayout.EndHorizontal();

            SplitterGUILayout.BeginVerticalSplit(spl);
            int rowHeight = RowHeight;

            EditorGUIUtility.SetIconSize(new Vector2(rowHeight, rowHeight));
            GUIContent tempContent      = new GUIContent();
            int        id               = GUIUtility.GetControlID(0);
            int        rowDoubleClicked = -1;

            /////@TODO: Make Frame selected work with ListViewState
            using (new GettingLogEntriesScope(m_ListView))
            {
                int  selectedRow      = -1;
                bool openSelectedItem = false;
                bool collapsed        = HasFlag(ConsoleFlags.Collapse);
                foreach (ListViewElement el in ListViewGUI.ListView(m_ListView, Constants.Box))
                {
                    if (e.type == EventType.MouseDown && e.button == 0 && el.position.Contains(e.mousePosition))
                    {
                        selectedRow = m_ListView.row;
                        if (e.clickCount == 2)
                        {
                            openSelectedItem = true;
                        }
                    }
                    else if (e.type == EventType.Repaint)
                    {
                        int    mode = 0;
                        string text = null;
                        LogEntries.GetLinesAndModeFromEntryInternal(el.row, Constants.LogStyleLineCount, ref mode, ref text);

                        // Draw the background
                        GUIStyle s = el.row % 2 == 0 ? Constants.OddBackground : Constants.EvenBackground;
                        s.Draw(el.position, false, false, m_ListView.row == el.row, false);

                        // Draw the icon
                        GUIStyle iconStyle = GetStyleForErrorMode(mode, true, Constants.LogStyleLineCount == 1);
                        iconStyle.Draw(el.position, false, false, m_ListView.row == el.row, false);

                        // Draw the text
                        tempContent.text = text;
                        GUIStyle errorModeStyle = GetStyleForErrorMode(mode, false, Constants.LogStyleLineCount == 1);
                        errorModeStyle.Draw(el.position, tempContent, id, m_ListView.row == el.row);

                        if (collapsed)
                        {
                            Rect badgeRect = el.position;
                            tempContent.text = LogEntries.GetEntryCount(el.row).ToString(CultureInfo.InvariantCulture);
                            Vector2 badgeSize = Constants.CountBadge.CalcSize(tempContent);
                            badgeRect.xMin  = badgeRect.xMax - badgeSize.x;
                            badgeRect.yMin += ((badgeRect.yMax - badgeRect.yMin) - badgeSize.y) * 0.5f;
                            badgeRect.x    -= 5f;
                            GUI.Label(badgeRect, tempContent, Constants.CountBadge);
                        }
                    }
                }

                if (selectedRow != -1)
                {
                    if (m_ListView.scrollPos.y >= m_ListView.rowHeight * m_ListView.totalRows - ms_LVHeight)
                    {
                        m_ListView.scrollPos.y = m_ListView.rowHeight * m_ListView.totalRows - ms_LVHeight - 1;
                    }
                }

                // Make sure the selected entry is up to date
                if (m_ListView.totalRows == 0 || m_ListView.row >= m_ListView.totalRows || m_ListView.row < 0)
                {
                    if (m_ActiveText.Length != 0)
                    {
                        SetActiveEntry(null);
                    }
                }
                else
                {
                    LogEntry entry = new LogEntry();
                    LogEntries.GetEntryInternal(m_ListView.row, entry);
                    SetActiveEntry(entry);

                    // see if selected entry changed. if so - clear additional info
                    LogEntries.GetEntryInternal(m_ListView.row, entry);
                    if (m_ListView.selectionChanged || !m_ActiveText.Equals(entry.condition))
                    {
                        SetActiveEntry(entry);
                    }
                }

                // Open entry using return key
                if ((GUIUtility.keyboardControl == m_ListView.ID) && (e.type == EventType.KeyDown) && (e.keyCode == KeyCode.Return) && (m_ListView.row != 0))
                {
                    selectedRow      = m_ListView.row;
                    openSelectedItem = true;
                }

                if (e.type != EventType.Layout && ListViewGUI.ilvState.rectHeight != 1)
                {
                    ms_LVHeight = ListViewGUI.ilvState.rectHeight;
                }

                if (openSelectedItem)
                {
                    rowDoubleClicked = selectedRow;
                    e.Use();
                }
            }

            // Prevent dead locking in EditorMonoConsole by delaying callbacks (which can log to the console) until after LogEntries.EndGettingEntries() has been
            // called (this releases the mutex in EditorMonoConsole so logging again is allowed). Fix for case 1081060.
            if (rowDoubleClicked != -1)
            {
                LogEntries.RowGotDoubleClicked(rowDoubleClicked);
            }

            EditorGUIUtility.SetIconSize(Vector2.zero);

            // Display active text (We want word wrapped text with a vertical scrollbar)
            m_TextScroll = GUILayout.BeginScrollView(m_TextScroll, Constants.Box);
            float height = Constants.MessageStyle.CalcHeight(GUIContent.Temp(m_ActiveText), position.width);

            EditorGUILayout.SelectableLabel(m_ActiveText, Constants.MessageStyle, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true), GUILayout.MinHeight(height));
            GUILayout.EndScrollView();

            SplitterGUILayout.EndVerticalSplit();

            // Copy & Paste selected item
            if ((e.type == EventType.ValidateCommand || e.type == EventType.ExecuteCommand) && e.commandName == EventCommandNames.Copy && m_ActiveText != string.Empty)
            {
                if (e.type == EventType.ExecuteCommand)
                {
                    EditorGUIUtility.systemCopyBuffer = m_ActiveText;
                }
                e.Use();
            }
        }
示例#12
0
        public void UpdateGUI()
        {
            SplitterGUILayout.BeginHorizontalSplit(this.horSplit);
            GUILayout.BeginVertical(this.constants.box, new GUILayoutOption[0]);
            GUILayout.Label(this.totalUpdates, this.constants.title, new GUILayoutOption[0]);
            foreach (ListViewElement listViewElement in ListViewGUILayout.ListView(this.lv, GUIStyle.none))
            {
                Rect position = listViewElement.position;
                ++position.x;
                ++position.y;
                if (Event.current.type == EventType.Repaint)
                {
                    if (listViewElement.row % 2 == 0)
                    {
                        this.constants.entryEven.Draw(position, false, false, false, false);
                    }
                    else
                    {
                        this.constants.entryOdd.Draw(position, false, false, false, false);
                    }
                }
                GUILayout.BeginVertical(listViewElement.row != this.lv.row ? this.constants.entryNormal : this.constants.entrySelected, new GUILayoutOption[0]);
                GUILayout.Label(this.messageFirstLines[listViewElement.row], this.constants.serverUpdateLog, new GUILayoutOption[1]
                {
                    GUILayout.MinWidth(50f)
                });
                GUILayout.BeginHorizontal();
                GUILayout.Label(this.changesets[listViewElement.row].changeset.ToString() + " " + this.changesets[listViewElement.row].date, this.constants.serverUpdateInfo, new GUILayoutOption[1]
                {
                    GUILayout.MinWidth(100f)
                });
                GUILayout.Label(this.changesets[listViewElement.row].owner, this.constants.serverUpdateInfo, new GUILayoutOption[1]
                {
                    GUILayout.Width((float)this.maxNickLength)
                });
                GUILayout.EndHorizontal();
                GUILayout.EndVertical();
            }
            if (this.lv.selectionChanged)
            {
                this.SetSelectedRevisionLine(this.lv.row);
            }
            GUILayout.EndVertical();
            SplitterGUILayout.BeginVerticalSplit(this.vertSplit);
            GUILayout.BeginVertical(this.constants.box, new GUILayoutOption[0]);
            GUILayout.Label("Changeset", this.constants.title, new GUILayoutOption[0]);
            int folder1 = -1;
            int file    = -1;

            foreach (ListViewElement listViewElement in ListViewGUILayout.ListView(this.pv.lv, GUIStyle.none))
            {
                if (folder1 == -1 && !this.pv.IndexToFolderAndFile(listViewElement.row, ref folder1, ref file))
                {
                    return;
                }
                ParentViewFolder folder2 = this.pv.folders[folder1];
                if (ListViewGUILayout.HasMouseDown(listViewElement.position))
                {
                    if (Event.current.clickCount == 2)
                    {
                        if (!this.isDirSelected && this.selectedGUID != string.Empty)
                        {
                            this.DoShowDiff(false);
                            GUIUtility.ExitGUI();
                        }
                    }
                    else
                    {
                        this.pv.lv.scrollPos = ListViewShared.ListViewScrollToRow((ListViewShared.InternalListViewState) this.pv.lv.ilvState, listViewElement.row);
                        this.DoSelect(folder1, file, listViewElement.row);
                    }
                }
                else if (ListViewGUILayout.HasMouseDown(listViewElement.position, 1))
                {
                    if (this.lv.row != listViewElement.row)
                    {
                        this.DoSelect(folder1, file, listViewElement.row);
                    }
                    if (!this.isDirSelected && this.selectedGUID != string.Empty)
                    {
                        GUIUtility.hotControl = 0;
                        EditorUtility.DisplayCustomMenu(new Rect(Event.current.mousePosition.x, Event.current.mousePosition.y, 1f, 1f), this.dropDownMenuItems, (int[])null, new EditorUtility.SelectMenuItemFunction(this.ContextMenuClick), (object)null);
                        Event.current.Use();
                    }
                }
                if (listViewElement.row == this.pv.lv.row && Event.current.type == EventType.Repaint)
                {
                    this.constants.entrySelected.Draw(listViewElement.position, false, false, false, false);
                }
                ChangeFlags changeFlags;
                if (file != -1)
                {
                    Texture2D texture2D = AssetDatabase.GetCachedIcon(folder2.name + "/" + folder2.files[file].name) as Texture2D;
                    if ((UnityEngine.Object)texture2D == (UnityEngine.Object)null)
                    {
                        texture2D = InternalEditorUtility.GetIconForFile(folder2.files[file].name);
                    }
                    GUILayout.Label(new GUIContent(folder2.files[file].name, (Texture)texture2D), this.constants.element, new GUILayoutOption[0]);
                    changeFlags = folder2.files[file].changeFlags;
                }
                else
                {
                    GUILayout.Label(folder2.name, this.constants.header, new GUILayoutOption[0]);
                    changeFlags = folder2.changeFlags;
                }
                GUIContent content = (GUIContent)null;
                if (this.HasFlag(changeFlags, ChangeFlags.Undeleted) || this.HasFlag(changeFlags, ChangeFlags.Created))
                {
                    content = ASMainWindow.constants.badgeNew;
                }
                else if (this.HasFlag(changeFlags, ChangeFlags.Deleted))
                {
                    content = ASMainWindow.constants.badgeDelete;
                }
                else if (this.HasFlag(changeFlags, ChangeFlags.Renamed) || this.HasFlag(changeFlags, ChangeFlags.Moved))
                {
                    content = ASMainWindow.constants.badgeMove;
                }
                if (content != null && Event.current.type == EventType.Repaint)
                {
                    Rect position = new Rect((float)((double)listViewElement.position.x + (double)listViewElement.position.width - (double)content.image.width - 5.0), listViewElement.position.y + listViewElement.position.height / 2f - (float)(content.image.height / 2), (float)content.image.width, (float)content.image.height);
                    EditorGUIUtility.SetIconSize(Vector2.zero);
                    GUIStyle.none.Draw(position, content, false, false, false, false);
                    EditorGUIUtility.SetIconSize(this.iconSize);
                }
                this.pv.NextFileFolder(ref folder1, ref file);
            }
            if (this.pv.lv.selectionChanged && this.selectedGUID != string.Empty)
            {
                if (this.selectedGUID != AssetServer.GetRootGUID())
                {
                    AssetServer.SetSelectionFromGUID(this.selectedGUID);
                }
                else
                {
                    AssetServer.SetSelectionFromGUID(string.Empty);
                }
            }
            if (GUIUtility.keyboardControl == this.pv.lv.ID && Event.current.type == EventType.KeyDown && (Event.current.keyCode == KeyCode.Return && !this.isDirSelected) && this.selectedGUID != string.Empty)
            {
                this.DoShowDiff(false);
                GUIUtility.ExitGUI();
            }
            GUILayout.EndVertical();
            GUILayout.BeginVertical(this.constants.box, new GUILayoutOption[0]);
            GUILayout.Label("Update Message", this.constants.title, new GUILayoutOption[0]);
            GUILayout.TextArea(this.lv.row < 0 ? string.Empty : this.changesets[this.lv.row].message, this.constants.wwText, new GUILayoutOption[0]);
            GUILayout.EndVertical();
            SplitterGUILayout.EndVerticalSplit();
            SplitterGUILayout.EndHorizontalSplit();
        }
示例#13
0
        void OnGUI()
        {
            CheckForPlatformModuleChange();
            InitializeIfNeeded();

            if (!m_CurrentArea.HasValue && Event.current.type == EventType.Repaint)
            {
                for (int i = 0; i < m_Charts.Length; i++)
                {
                    if (m_Charts[i].active)
                    {
                        m_Charts[i].ChartSelected();
                        break;
                    }
                }
            }
            // Initialization
            DrawMainToolbar();

            SplitterGUILayout.BeginVerticalSplit(m_VertSplit);

            m_GraphPos = EditorGUILayout.BeginScrollView(m_GraphPos, Styles.profilerGraphBackground);

            if (m_PrevLastFrame != ProfilerDriver.lastFrameIndex)
            {
                UpdateCharts();
                m_PrevLastFrame = ProfilerDriver.lastFrameIndex;
            }

            int newCurrentFrame = m_CurrentFrame;

            for (int c = 0; c < m_Charts.Length; ++c)
            {
                var chart = m_Charts[c];
                if (!chart.active)
                {
                    continue;
                }

                newCurrentFrame = chart.DoChartGUI(newCurrentFrame, m_CurrentArea == chart.m_Area);
            }

            if (newCurrentFrame != m_CurrentFrame)
            {
                SetCurrentFrame(newCurrentFrame);
                Repaint();
                GUIUtility.ExitGUI();
            }

            EditorGUILayout.EndScrollView();

            GUILayout.BeginVertical();
            if (m_CurrentArea.HasValue)
            {
                var detailViewPosition = new Rect(0, m_VertSplit.realSizes[0] + EditorGUI.kSingleLineHeight, position.width, m_VertSplit.realSizes[1]);

                var detailViewToolbar = detailViewPosition;
                detailViewToolbar.height = EditorStyles.toolbar.CalcHeight(GUIContent.none, 10.0f);
                m_ProfilerModules[(int)m_CurrentArea].DrawToolbar(detailViewPosition);

                detailViewPosition.yMin += detailViewToolbar.height;
                m_ProfilerModules[(int)m_CurrentArea].DrawView(detailViewPosition);
            }
            else
            {
                EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();
            }
            GUILayout.EndVertical();
            SplitterGUILayout.EndVerticalSplit();
        }
示例#14
0
        private void OnGUI()
        {
            Event current = Event.current;

            LoadIcons();
            GUILayout.BeginHorizontal(Constants.Toolbar, new GUILayoutOption[0]);
            if (GUILayout.Button("Clear", Constants.MiniButton, new GUILayoutOption[0]))
            {
                LogEntries.Clear();
                GUIUtility.keyboardControl = 0;
            }
            int count = LogEntries.GetCount();

            if ((this.m_ListView.totalRows != count) && (this.m_ListView.scrollPos.y >= ((this.m_ListView.rowHeight * this.m_ListView.totalRows) - this.ms_LVHeight)))
            {
                this.m_ListView.scrollPos.y = (count * 0x20) - this.ms_LVHeight;
            }
            EditorGUILayout.Space();
            bool flag = this.HasFlag(ConsoleFlags.Collapse);

            this.SetFlag(ConsoleFlags.Collapse, GUILayout.Toggle(flag, "Collapse", Constants.MiniButtonLeft, new GUILayoutOption[0]));
            if (flag != this.HasFlag(ConsoleFlags.Collapse))
            {
                this.m_ListView.row         = -1;
                this.m_ListView.scrollPos.y = LogEntries.GetCount() * 0x20;
            }
            this.SetFlag(ConsoleFlags.ClearOnPlay, GUILayout.Toggle(this.HasFlag(ConsoleFlags.ClearOnPlay), "Clear on Play", Constants.MiniButtonMiddle, new GUILayoutOption[0]));
            this.SetFlag(ConsoleFlags.ErrorPause, GUILayout.Toggle(this.HasFlag(ConsoleFlags.ErrorPause), "Error Pause", Constants.MiniButtonRight, new GUILayoutOption[0]));
            EditorGUILayout.Space();
            if (this.m_DevBuild)
            {
                GUILayout.FlexibleSpace();
                this.SetFlag(ConsoleFlags.StopForAssert, GUILayout.Toggle(this.HasFlag(ConsoleFlags.StopForAssert), "Stop for Assert", Constants.MiniButtonLeft, new GUILayoutOption[0]));
                this.SetFlag(ConsoleFlags.StopForError, GUILayout.Toggle(this.HasFlag(ConsoleFlags.StopForError), "Stop for Error", Constants.MiniButtonRight, new GUILayoutOption[0]));
            }
            GUILayout.FlexibleSpace();
            int errorCount   = 0;
            int warningCount = 0;
            int logCount     = 0;

            LogEntries.GetCountsByType(ref errorCount, ref warningCount, ref logCount);
            bool val   = GUILayout.Toggle(this.HasFlag(ConsoleFlags.LogLevelLog), new GUIContent((logCount > 0x3e7) ? "999+" : logCount.ToString(), (logCount <= 0) ? iconInfoMono : iconInfoSmall), Constants.MiniButtonRight, new GUILayoutOption[0]);
            bool flag4 = GUILayout.Toggle(this.HasFlag(ConsoleFlags.LogLevelWarning), new GUIContent((warningCount > 0x3e7) ? "999+" : warningCount.ToString(), (warningCount <= 0) ? iconWarnMono : iconWarnSmall), Constants.MiniButtonMiddle, new GUILayoutOption[0]);
            bool flag5 = GUILayout.Toggle(this.HasFlag(ConsoleFlags.LogLevelError), new GUIContent((errorCount > 0x3e7) ? "999+" : errorCount.ToString(), (errorCount <= 0) ? iconErrorMono : iconErrorSmall), Constants.MiniButtonLeft, new GUILayoutOption[0]);

            this.SetFlag(ConsoleFlags.LogLevelLog, val);
            this.SetFlag(ConsoleFlags.LogLevelWarning, flag4);
            this.SetFlag(ConsoleFlags.LogLevelError, flag5);
            GUILayout.EndHorizontal();
            this.m_ListView.totalRows = LogEntries.StartGettingEntries();
            SplitterGUILayout.BeginVerticalSplit(this.spl, new GUILayoutOption[0]);
            EditorGUIUtility.SetIconSize(new Vector2(32f, 32f));
            GUIContent content   = new GUIContent();
            int        controlID = GUIUtility.GetControlID(FocusType.Native);

            try
            {
                bool        flag6      = false;
                bool        flag7      = this.HasFlag(ConsoleFlags.Collapse);
                IEnumerator enumerator = ListViewGUI.ListView(this.m_ListView, Constants.Box, new GUILayoutOption[0]).GetEnumerator();
                try
                {
                    while (enumerator.MoveNext())
                    {
                        ListViewElement element = (ListViewElement)enumerator.Current;
                        if (((current.type == EventType.MouseDown) && (current.button == 0)) && element.position.Contains(current.mousePosition))
                        {
                            if (current.clickCount == 2)
                            {
                                LogEntries.RowGotDoubleClicked(this.m_ListView.row);
                            }
                            flag6 = true;
                        }
                        if (current.type == EventType.Repaint)
                        {
                            int    mask      = 0;
                            string outString = null;
                            LogEntries.GetFirstTwoLinesEntryTextAndModeInternal(element.row, ref mask, ref outString);
                            (((element.row % 2) != 0) ? Constants.EvenBackground : Constants.OddBackground).Draw(element.position, false, false, this.m_ListView.row == element.row, false);
                            content.text = outString;
                            GetStyleForErrorMode(mask).Draw(element.position, content, controlID, this.m_ListView.row == element.row);
                            if (flag7)
                            {
                                Rect position = element.position;
                                content.text = LogEntries.GetEntryCount(element.row).ToString(CultureInfo.InvariantCulture);
                                Vector2 vector = Constants.CountBadge.CalcSize(content);
                                position.xMin  = position.xMax - vector.x;
                                position.yMin += ((position.yMax - position.yMin) - vector.y) * 0.5f;
                                position.x    -= 5f;
                                GUI.Label(position, content, Constants.CountBadge);
                            }
                        }
                    }
                }
                finally
                {
                    IDisposable disposable = enumerator as IDisposable;
                    if (disposable == null)
                    {
                    }
                    disposable.Dispose();
                }
                if (flag6 && (this.m_ListView.scrollPos.y >= ((this.m_ListView.rowHeight * this.m_ListView.totalRows) - this.ms_LVHeight)))
                {
                    this.m_ListView.scrollPos.y = ((this.m_ListView.rowHeight * this.m_ListView.totalRows) - this.ms_LVHeight) - 1;
                }
                if (((this.m_ListView.totalRows == 0) || (this.m_ListView.row >= this.m_ListView.totalRows)) || (this.m_ListView.row < 0))
                {
                    if (this.m_ActiveText.Length != 0)
                    {
                        this.SetActiveEntry(null);
                    }
                }
                else
                {
                    LogEntry outputEntry = new LogEntry();
                    LogEntries.GetEntryInternal(this.m_ListView.row, outputEntry);
                    this.SetActiveEntry(outputEntry);
                    LogEntries.GetEntryInternal(this.m_ListView.row, outputEntry);
                    if (this.m_ListView.selectionChanged || !this.m_ActiveText.Equals(outputEntry.condition))
                    {
                        this.SetActiveEntry(outputEntry);
                    }
                }
                if (((GUIUtility.keyboardControl == this.m_ListView.ID) && (current.type == EventType.KeyDown)) && ((current.keyCode == KeyCode.Return) && (this.m_ListView.row != 0)))
                {
                    LogEntries.RowGotDoubleClicked(this.m_ListView.row);
                    Event.current.Use();
                }
                if ((current.type != EventType.Layout) && (ListViewGUI.ilvState.rectHeight != 1))
                {
                    this.ms_LVHeight = ListViewGUI.ilvState.rectHeight;
                }
            }
            finally
            {
                LogEntries.EndGettingEntries();
                EditorGUIUtility.SetIconSize(Vector2.zero);
            }
            this.m_TextScroll = GUILayout.BeginScrollView(this.m_TextScroll, Constants.Box);
            float minHeight = Constants.MessageStyle.CalcHeight(GUIContent.Temp(this.m_ActiveText), base.position.width);

            GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true), GUILayout.MinHeight(minHeight) };
            EditorGUILayout.SelectableLabel(this.m_ActiveText, Constants.MessageStyle, options);
            GUILayout.EndScrollView();
            SplitterGUILayout.EndVerticalSplit();
            if (((current.type == EventType.ValidateCommand) || (current.type == EventType.ExecuteCommand)) && ((current.commandName == "Copy") && (this.m_ActiveText != string.Empty)))
            {
                if (current.type == EventType.ExecuteCommand)
                {
                    EditorGUIUtility.systemCopyBuffer = this.m_ActiveText;
                }
                current.Use();
            }
        }
示例#15
0
        private void OnGUI()
        {
            this.CheckForPlatformModuleChange();
            if (ProfilerWindow.ms_Styles == null)
            {
                ProfilerWindow.ms_Styles = new ProfilerWindow.Styles();
            }
            if (!this.m_HasProfilerLicense)
            {
                GUILayout.Label(ProfilerWindow.ms_Styles.noLicense, EditorStyles.largeLabel, new GUILayoutOption[0]);
                return;
            }
            this.DrawMainToolbar();
            SplitterGUILayout.BeginVerticalSplit(this.m_VertSplit, new GUILayoutOption[0]);
            this.m_GraphPos = EditorGUILayout.BeginScrollView(this.m_GraphPos, ProfilerWindow.ms_Styles.profilerGraphBackground, new GUILayoutOption[0]);
            if (this.m_PrevLastFrame != ProfilerDriver.lastFrameIndex)
            {
                this.UpdateCharts();
                this.m_PrevLastFrame = ProfilerDriver.lastFrameIndex;
            }
            int num = this.m_CurrentFrame;

            Chart.ChartAction[] array = new Chart.ChartAction[this.m_Charts.Length];
            for (int i = 0; i < this.m_Charts.Length; i++)
            {
                ProfilerChart profilerChart = this.m_Charts[i];
                if (profilerChart.active)
                {
                    num = profilerChart.DoChartGUI(num, this.m_CurrentArea, out array[i]);
                }
            }
            bool flag = false;

            if (num != this.m_CurrentFrame)
            {
                this.SetCurrentFrame(num);
                flag = true;
            }
            for (int j = 0; j < this.m_Charts.Length; j++)
            {
                ProfilerChart profilerChart2 = this.m_Charts[j];
                if (profilerChart2.active)
                {
                    if (array[j] == Chart.ChartAction.Closed)
                    {
                        if (this.m_CurrentArea == (ProfilerArea)j)
                        {
                            this.m_CurrentArea = ProfilerArea.CPU;
                        }
                        profilerChart2.active = false;
                    }
                    else
                    {
                        if (array[j] == Chart.ChartAction.Activated)
                        {
                            this.m_CurrentArea = (ProfilerArea)j;
                            if (this.m_CurrentArea != ProfilerArea.CPU && this.m_CPUHierarchyGUI.selectedIndex != -1)
                            {
                                this.ClearSelectedPropertyPath();
                            }
                            flag = true;
                        }
                    }
                }
            }
            if (flag)
            {
                base.Repaint();
                GUIUtility.ExitGUI();
            }
            GUILayout.EndScrollView();
            GUILayout.BeginVertical(new GUILayoutOption[0]);
            switch (this.m_CurrentArea)
            {
            case ProfilerArea.CPU:
                this.DrawCPUOrRenderingPane(this.m_CPUHierarchyGUI, this.m_CPUDetailHierarchyGUI, this.m_CPUTimelineGUI);
                goto IL_255;

            case ProfilerArea.GPU:
                this.DrawCPUOrRenderingPane(this.m_GPUHierarchyGUI, this.m_GPUDetailHierarchyGUI, null);
                goto IL_255;

            case ProfilerArea.Memory:
                this.DrawMemoryPane(this.m_ViewSplit);
                goto IL_255;

            case ProfilerArea.Audio:
                this.DrawAudioPane();
                goto IL_255;
            }
            this.DrawPane(this.m_CurrentArea);
IL_255:
            GUILayout.EndVertical();
            SplitterGUILayout.EndVerticalSplit();
        }