private void InitIfNeeded(ProfilerWindow win)
        {
            if (m_ZoomablePreview != null)
            {
                return;
            }

            m_ZoomablePreview = new ZoomableArea(true, false)
            {
                hRangeMin = 0.0f,
                vRangeMin = 0.0f,
                hRangeMax = 1.0f,
                vRangeMax = 1.0f
            };

            m_ZoomablePreview.SetShownHRange(0, 1);
            m_ZoomablePreview.SetShownVRange(0, 1);

            m_ZoomablePreview.uniformScale    = true;
            m_ZoomablePreview.scaleWithWindow = true;

            var initwidth = 100;
            var maxWidth  = 200;

            m_MulticolumnHeaderState = new MultiColumnHeaderState(new[]
            {
                new MultiColumnHeaderState.Column {
                    headerContent = EditorGUIUtility.TrTextContent("Object"), width = 220, maxWidth = 400, canSort = true
                },
                new MultiColumnHeaderState.Column {
                    headerContent = EditorGUIUtility.TrTextContent("Self Batch Count"), width = initwidth, maxWidth = maxWidth
                },
                new MultiColumnHeaderState.Column {
                    headerContent = EditorGUIUtility.TrTextContent("Cumulative Batch Count"), width = initwidth, maxWidth = maxWidth
                },
                new MultiColumnHeaderState.Column {
                    headerContent = EditorGUIUtility.TrTextContent("Self Vertex Count"), width = initwidth, maxWidth = maxWidth
                },
                new MultiColumnHeaderState.Column {
                    headerContent = EditorGUIUtility.TrTextContent("Cumulative Vertex Count"), width = initwidth, maxWidth = maxWidth
                },
                new MultiColumnHeaderState.Column
                {
                    headerContent = EditorGUIUtility.TrTextContent("Batch Breaking Reason"),
                    width         = 220,
                    maxWidth      = 400,
                    canSort       = false
                },
                new MultiColumnHeaderState.Column {
                    headerContent = EditorGUIUtility.TrTextContent("GameObject Count"), width = initwidth, maxWidth = 400
                },
                new MultiColumnHeaderState.Column {
                    headerContent = EditorGUIUtility.TrTextContent("GameObjects"), width = 150, maxWidth = 400, canSort = false
                },
            });
            foreach (var column in m_MulticolumnHeaderState.columns)
            {
                column.sortingArrowAlignment = TextAlignment.Right;
            }

            m_UGUIProfilerTreeViewState = new UISystemProfilerTreeView.State {
                profilerWindow = win
            };
            var multiColumnHeader = new Headers(m_MulticolumnHeaderState)
            {
                canSort = true, height = 21
            };

            multiColumnHeader.sortingChanged += header => { m_TreeViewControl.Reload(); };
            m_TreeViewControl = new UISystemProfilerTreeView(m_UGUIProfilerTreeViewState, multiColumnHeader);
            m_TreeViewControl.Reload();
        }
Esempio n. 2
0
 private void InitIfNeeded(ProfilerWindow win)
 {
     if (this.m_ZoomablePreview == null)
     {
         this.m_ZoomablePreview = new ZoomableArea(true, false)
         {
             hRangeMin = 0f,
             vRangeMin = 0f,
             hRangeMax = 1f,
             vRangeMax = 1f
         };
         this.m_ZoomablePreview.SetShownHRange(0f, 1f);
         this.m_ZoomablePreview.SetShownVRange(0f, 1f);
         this.m_ZoomablePreview.uniformScale    = true;
         this.m_ZoomablePreview.scaleWithWindow = true;
         int num  = 100;
         int num2 = 200;
         this.m_MulticolumnHeaderState = new MultiColumnHeaderState(new MultiColumnHeaderState.Column[]
         {
             new MultiColumnHeaderState.Column
             {
                 headerContent = EditorGUIUtility.TrTextContent("Object", null, null),
                 width         = 220f,
                 maxWidth      = 400f,
                 canSort       = true
             },
             new MultiColumnHeaderState.Column
             {
                 headerContent = EditorGUIUtility.TrTextContent("Self Batch Count", null, null),
                 width         = (float)num,
                 maxWidth      = (float)num2
             },
             new MultiColumnHeaderState.Column
             {
                 headerContent = EditorGUIUtility.TrTextContent("Cumulative Batch Count", null, null),
                 width         = (float)num,
                 maxWidth      = (float)num2
             },
             new MultiColumnHeaderState.Column
             {
                 headerContent = EditorGUIUtility.TrTextContent("Self Vertex Count", null, null),
                 width         = (float)num,
                 maxWidth      = (float)num2
             },
             new MultiColumnHeaderState.Column
             {
                 headerContent = EditorGUIUtility.TrTextContent("Cumulative Vertex Count", null, null),
                 width         = (float)num,
                 maxWidth      = (float)num2
             },
             new MultiColumnHeaderState.Column
             {
                 headerContent = EditorGUIUtility.TrTextContent("Batch Breaking Reason", null, null),
                 width         = 220f,
                 maxWidth      = 400f,
                 canSort       = false
             },
             new MultiColumnHeaderState.Column
             {
                 headerContent = EditorGUIUtility.TrTextContent("GameObject Count", null, null),
                 width         = (float)num,
                 maxWidth      = 400f
             },
             new MultiColumnHeaderState.Column
             {
                 headerContent = EditorGUIUtility.TrTextContent("GameObjects", null, null),
                 width         = 150f,
                 maxWidth      = 400f,
                 canSort       = false
             }
         });
         MultiColumnHeaderState.Column[] columns = this.m_MulticolumnHeaderState.columns;
         for (int i = 0; i < columns.Length; i++)
         {
             MultiColumnHeaderState.Column column = columns[i];
             column.sortingArrowAlignment = TextAlignment.Right;
         }
         this.m_UGUIProfilerTreeViewState = new UISystemProfilerTreeView.State
         {
             profilerWindow = win
         };
         UISystemProfiler.Headers headers = new UISystemProfiler.Headers(this.m_MulticolumnHeaderState)
         {
             canSort = true,
             height  = 21f
         };
         headers.sortingChanged += delegate(MultiColumnHeader header)
         {
             this.m_TreeViewControl.Reload();
         };
         this.m_TreeViewControl = new UISystemProfilerTreeView(this.m_UGUIProfilerTreeViewState, headers);
         this.m_TreeViewControl.Reload();
     }
 }
Esempio n. 3
0
 public UISystemProfilerTreeView(UISystemProfilerTreeView.State state, MultiColumnHeader multiColumnHeader) : base(state, multiColumnHeader)
 {
     this.m_Comparer = new UISystemProfilerTreeView.CanvasBatchComparer();
     base.showBorder = false;
     base.showAlternatingRowBackgrounds = true;
 }