Exemplo n.º 1
0
 public override void DrawDetailsView(Rect position)
 {
     if (m_TimelineGUI != null && m_ViewType == ProfilerViewType.Timeline)
     {
         if (Event.current.isKey)
         {
             ProfilerWindowAnalytics.RecordViewKeyboardEvent(ProfilerWindowAnalytics.profilerCPUModuleTimeline);
         }
         if (Event.current.isMouse && position.Contains(Event.current.mousePosition))
         {
             ProfilerWindowAnalytics.RecordViewMouseEvent(ProfilerWindowAnalytics.profilerCPUModuleTimeline);
         }
         CurrentFrameIndex = (int)ProfilerWindow.selectedFrameIndex;
         m_TimelineGUI.DoGUI(CurrentFrameIndex, position, fetchData, ref updateViewLive);
     }
     else
     {
         if (Event.current.isKey)
         {
             ProfilerWindowAnalytics.RecordViewKeyboardEvent(ProfilerWindowAnalytics.profilerCPUModuleHierarchy);
         }
         if (Event.current.isMouse && position.Contains(Event.current.mousePosition))
         {
             ProfilerWindowAnalytics.RecordViewMouseEvent(ProfilerWindowAnalytics.profilerCPUModuleHierarchy);
         }
         base.DrawDetailsView(position);
     }
 }
Exemplo n.º 2
0
 public override void DrawView(Rect position)
 {
     if (m_TimelineGUI != null && m_ViewType == ProfilerViewType.Timeline)
     {
         m_TimelineGUI.DoGUI(m_ProfilerWindow.GetActiveVisibleFrameIndex(), position);
     }
     else
     {
         base.DrawView(position);
     }
 }
Exemplo n.º 3
0
        private void DrawCPUOrRenderingPane(ProfilerHierarchyGUI mainPane, ProfilerHierarchyGUI detailPane, ProfilerTimelineGUI timelinePane)
        {
            ProfilerProperty profilerProperty = this.CreateProperty(false);

            this.DrawCPUOrRenderingToolbar(profilerProperty);
            if (!ProfilerWindow.CheckFrameData(profilerProperty))
            {
                profilerProperty.Cleanup();
                return;
            }
            if (timelinePane != null && this.m_ViewType == ProfilerViewType.Timeline)
            {
                float num = (float)this.m_VertSplit.realSizes[1];
                num -= EditorStyles.toolbar.CalcHeight(GUIContent.none, 10f) + 2f;
                timelinePane.DoGUI(this.GetActiveVisibleFrameIndex(), base.position.width, base.position.height - num, num);
                profilerProperty.Cleanup();
            }
            else
            {
                SplitterGUILayout.BeginHorizontalSplit(this.m_ViewSplit, new GUILayoutOption[0]);
                GUILayout.BeginVertical(new GUILayoutOption[0]);
                bool expandAll = false;
                mainPane.DoGUI(profilerProperty, this.m_SearchString, expandAll);
                profilerProperty.Cleanup();
                GUILayout.EndVertical();
                GUILayout.BeginVertical(new GUILayoutOption[0]);
                ProfilerProperty profilerProperty2 = this.CreateProperty(true);
                ProfilerProperty detailedProperty  = mainPane.GetDetailedProperty(profilerProperty2);
                profilerProperty2.Cleanup();
                if (detailedProperty != null)
                {
                    detailPane.DoGUI(detailedProperty, string.Empty, expandAll);
                    detailedProperty.Cleanup();
                }
                else
                {
                    ProfilerWindow.DrawEmptyCPUOrRenderingDetailPane();
                }
                GUILayout.EndVertical();
                SplitterGUILayout.EndHorizontalSplit();
            }
        }