void InitIfNeeded()
        {
            if (m_Initialized)
            {
                return;
            }

            if (m_VertSplit == null || m_VertSplit.relativeSizes == null || m_VertSplit.relativeSizes.Length == 0)
            {
                m_VertSplit = new SplitterState(new[] { 40f, 60f }, new[] { 50, 50 }, null);
            }

            if (m_CalleesTreeView == null)
            {
                m_CalleesTreeView = new CallsTreeViewController();
            }
            m_CalleesTreeView.SetType(CallsTreeView.Type.Callees);
            m_CalleesTreeView.frameItemEvent += frameItemEvent;

            if (m_CallersTreeView == null)
            {
                m_CallersTreeView = new CallsTreeViewController();
            }
            m_CallersTreeView.SetType(CallsTreeView.Type.Callers);
            m_CallersTreeView.frameItemEvent += frameItemEvent;

            callersAndCalleeData = new ProfilerCallersAndCalleeData();

            m_Initialized = true;
        }
Example #2
0
        void InitIfNeeded()
        {
            if (m_Initialized)
            {
                return;
            }

            if (m_VertSplit == null || m_VertSplit.relativeSizes == null || m_VertSplit.relativeSizes.Length == 0)
            {
                m_VertSplit = new SplitterState(new[] { SessionState.GetFloat(spillter0StatePrefKey, 40f), SessionState.GetFloat(spillter1StatePrefKey, 60f) }, new[] { 50, 50 }, null);
            }

            if (m_FrameDataView != null && m_FrameDataView.valid && m_SelectedID >= 0)
            {
                var restoredPath = m_FrameDataView.GetItemPath(m_SelectedID);
                var storedPath   = SessionState.GetString(selectedIDpathprefKey, string.Empty);
                if (restoredPath != storedPath)
                {
                    m_SelectedID = -1;
                }
            }
            else
            {
                m_SelectedID = -1;
            }

            if (m_CalleesTreeView == null)
            {
                m_CalleesTreeView = new CallsTreeViewController(callsTreePrefKeyPrefix);
            }
            m_CalleesTreeView.SetType(CallsTreeView.Type.Callees);
            m_CalleesTreeView.frameItemEvent += frameItemEvent;

            if (m_CallersTreeView == null)
            {
                m_CallersTreeView = new CallsTreeViewController(calleesTreePrefKey);
            }
            m_CallersTreeView.SetType(CallsTreeView.Type.Callers);
            m_CallersTreeView.frameItemEvent += frameItemEvent;

            callersAndCalleeData = new ProfilerCallersAndCalleeData();
            callersAndCalleeData.profilerSampleNameProvider = profilerSampleNameProvider;

            m_TotalSelectedPropertyTimeLabel = new GUIContent(Content.totalSelectedPropertyTimeLabel);

            m_Initialized = true;
        }