예제 #1
0
 void InitializeGraphView(EventGraphListView graphView)
 {
     graphView.DefineGraph("FrameCount", 1, new GraphLayerBarChartMesh(1, "FPS", "Current Frame Rate", Color.blue),
                           new GraphLayerLabel(1, "FPS", "Current Frame Rate", Color.white, GraphColors.LabelGraphLabelBackground, v => string.Format("{0} FPS", v)));
     graphView.DefineGraph("MemoryCount", 2, new GraphLayerBarChartMesh(2, "MonoHeap", "Current Mono Heap Size", Color.green * .75f),
                           new GraphLayerLabel(2, "MonoHeap", "Current Mono Heap Size", Color.white, GraphColors.LabelGraphLabelBackground, v => string.Format("{0:0.0}MB", (v / 1024f))));
     OnInitializeGraphView(graphView);
 }
예제 #2
0
 protected virtual void OnInitializeGraphView(EventGraphListView graphView)
 {
 }
예제 #3
0
        void InitializeGui()
        {
            if (m_GraphList == null)
            {
                if (m_GraphListTreeViewState == null)
                {
                    m_GraphListTreeViewState = new TreeViewState();
                }

                var headerState = EventGraphListView.CreateDefaultHeaderState();
                if (MultiColumnHeaderState.CanOverwriteSerializedFields(m_GraphListMchs, headerState))
                {
                    MultiColumnHeaderState.OverwriteSerializedFields(m_GraphListMchs, headerState);
                }

                m_GraphListMchs = headerState;
                m_GraphList     = new EventGraphListView(() => { return(activeSession == null ? null : activeSession.RootStreamEntry); }, m_GraphListTreeViewState, m_GraphListMchs, CanHandleEvent, this);
                InitializeGraphView(m_GraphList);
                m_GraphList.Reload();
            }

            if (m_EventList == null)
            {
                if (m_EventListTreeViewState == null)
                {
                    m_EventListTreeViewState = new TreeViewState();
                }

                var columns = new List <string>();
                var sizes   = new List <float>();
                OnGetColumns(columns, sizes);
                var headerState = EventListView.CreateDefaultMultiColumnHeaderState(columns, sizes);
                if (MultiColumnHeaderState.CanOverwriteSerializedFields(m_EventListMchs, headerState))
                {
                    MultiColumnHeaderState.OverwriteSerializedFields(m_EventListMchs, headerState);
                }

                m_EventListMchs = headerState;
                m_EventList     = new EventListView(m_EventListTreeViewState, m_EventListMchs, DrawColumnCell, OnDisplayEvent);
                m_EventList.Reload();
            }

            if (m_EventListFrame != m_InspectFrame && m_InspectFrame != m_LatestFrame && !m_DraggingInspectLine && Time.unscaledTime - m_LastEventListUpdate > .25f)
            {
                if (activeSession != null)
                {
                    m_EventList.SetEvents(activeSession.GetFrameEvents(m_InspectFrame));
                }
                m_LastEventListUpdate = Time.unscaledTime;
                m_EventListFrame      = m_InspectFrame;
            }

            if (m_GraphListMchs != null && m_GraphListMchs.columns.Length > 2)
            {
                string warningText = string.Empty;
                if (!ProjectConfigData.postProfilerEvents)
                {
                    warningText = "Warning: Profile events must be enabled in your Addressable Asset settings to view profile data";
                }
                m_GraphListMchs.columns[2].headerContent.text = warningText;
            }
        }