コード例 #1
0
        public virtual int DoChartGUI(Rect chartRect, int currentFrame, bool active)
        {
            if (Event.current.type == EventType.Repaint)
            {
                string[] labels = new string[m_Series.Length];
                for (int s = 0; s < m_Series.Length; s++)
                {
                    string name =
                        m_Data.hasOverlay ?
                        "Selected" + m_Series[s].name :
                        m_Series[s].name;
                    if (usesCounters)
                    {
                        labels[s] = ProfilerDriver.GetFormattedCounterValue(currentFrame, m_Series[s].category, name);
                    }
                    else
                    {
                        labels[s] = ProfilerDriver.GetFormattedCounterValue(currentFrame, m_Area, name);
                    }
                }
                m_Data.AssignSelectedLabels(labels);
            }

            if (legendHeaderLabel == null)
            {
                legendHeaderLabel = new GUIContent(m_LocalizedName, EditorGUIUtility.LoadIconRequired(m_IconName), Tooltip);
            }

            return(DoGUI(chartRect, m_Type, currentFrame, m_Data, active));
        }
コード例 #2
0
        public virtual int DoChartGUI(int currentFrame, bool active)
        {
            if (Event.current.type == EventType.Repaint)
            {
                string[] labels = new string[m_Series.Length];
                for (int s = 0; s < m_Series.Length; s++)
                {
                    string name =
                        m_Data.hasOverlay ?
                        "Selected" + m_Series[s].name :
                        m_Series[s].name;
                    labels[s] = ProfilerDriver.GetFormattedCounterValue(currentFrame, m_Area, name);
                }
                m_Data.AssignSelectedLabels(labels);
            }

            if (legendHeaderLabel == null)
            {
                string iconName = string.Format("Profiler.{0}", System.Enum.GetName(typeof(ProfilerArea), m_Area));
                legendHeaderLabel = EditorGUIUtility.TextContentWithIcon(GetLocalizedChartName(), iconName);
            }

            return(DoGUI(m_Type, currentFrame, m_Data, active));
        }