Beispiel #1
0
        void CellGUI(Rect cellRect, ProfileTreeViewItem item, MyColumns column, ref RowGUIArgs args)
        {
            // Center cell rect vertically (makes it easier to place controls, icons etc in the cells)
            CenterRectUsingSingleLineHeight(ref cellRect);

            GUIContent content = item.cachedRowString[(int)column];

            switch (column)
            {
            case MyColumns.Name:
            {
                args.rowRect = cellRect;
                //base.RowGUI(args);
                //content = new GUIContent(item.data.name, item.data.name);
                ShowText(cellRect, content);
            }
            break;

            case MyColumns.Mean:
            case MyColumns.Depth:
            case MyColumns.Median:
            case MyColumns.Min:
            case MyColumns.Max:
            case MyColumns.Range:
            case MyColumns.Count:
            case MyColumns.CountMean:
            case MyColumns.AtMedian:
            case MyColumns.Total:
            case MyColumns.Threads:
                ShowText(cellRect, content);
                break;

            case MyColumns.MedianBar:
                ShowBar(cellRect, item.data.msMedian, m_MaxMedian, content);
                break;

            case MyColumns.TotalBar:
                ShowBar(cellRect, (float)item.data.msTotal, (float)m_MaxTotal, content);
                break;

            case MyColumns.CountBar:
                ShowBar(cellRect, item.data.count, m_MaxCount, content);
                break;

            case MyColumns.CountMeanBar:
                ShowBar(cellRect, item.data.countMean, m_MaxCountMean, content);
                break;

            case MyColumns.FirstFrame:
                if (!m_ProfileAnalyzerWindow.IsProfilerWindowOpen())
                {
                    GUI.enabled = false;
                }
                if (GUI.Button(cellRect, content))
                {
                    m_ProfileAnalyzerWindow.SelectMarkerByIndex(item.id);
                    m_ProfileAnalyzerWindow.JumpToFrame(item.data.firstFrameIndex);
                }

                GUI.enabled = true;
                break;
            }

            ShowContextMenu(cellRect, item.data.name, content);
        }