Пример #1
0
        protected override TreeViewItem BuildRoot()
        {
            int idForhiddenRoot    = -1;
            int depthForHiddenRoot = -1;
            int index = 0;
            FileSummaryTreeViewItem root       = new FileSummaryTreeViewItem(idForhiddenRoot, depthForHiddenRoot, "root", null);
            FileIOFrameSetup        frameSetup = m_ProfilerView.GetFrameSetup();
            int currentFrame = m_ProfilerView.GetSelectedFrame();

            foreach (var fileSummary in m_CaptureData.m_FileSummaryData.Values)
            {
                var filename = Path.GetFileName(fileSummary.filename);

                if (!m_ProfilerView.FilterContains(filename))
                {
                    continue;
                }

                if (frameSetup == FileIOFrameSetup.ThisFrame)
                {
                    if (!fileSummary.frameIndices.Contains(currentFrame))
                    {
                        continue;
                    }
                }

                var item = new FileSummaryTreeViewItem(index, 0, fileSummary.filename, fileSummary);
                root.AddChild(item);
                index++;
            }

            // Return root of the tree
            return(root);
        }
Пример #2
0
        bool FileIOFrameCountProfileToggle()
        {
            FileIOFrameSetup oldFrameCount = selectedFrameSetup;
            FileIOFrameSetup newFrameCount = (FileIOFrameSetup)EditorGUILayout.EnumPopup(oldFrameCount, EditorStyles.toolbarDropDownLeft, GUILayout.Width(150f));

            if (oldFrameCount != newFrameCount)
            {
                selectedFrameSetup = newFrameCount;
            }
            return(oldFrameCount != newFrameCount);
        }
Пример #3
0
        protected override TreeViewItem BuildRoot()
        {
            int idForhiddenRoot               = -1;
            int depthForHiddenRoot            = -1;
            FileAccessTreeViewItem root       = new FileAccessTreeViewItem(idForhiddenRoot, depthForHiddenRoot, "root", null);
            FileIOFrameSetup       frameSetup = m_ProfilerView.GetFrameSetup();
            int currentFrame = m_ProfilerView.GetSelectedFrame();

            if (!m_CaptureData.accessesSorted)
            {
                m_CaptureData.m_FileAccessData.Sort((data1, data2) => data1.startNs.CompareTo(data2.startNs));
                m_CaptureData.accessesSorted = true;
            }

            var data = m_CaptureData.m_FileAccessData;

            for (int index = 0, id = 0; index < data.Count; ++index)
            {
                var fileAccess = data[index];

                var filename = Path.GetFileName(fileAccess.filename);

                if (!m_ProfilerView.FilterContains(filename))
                {
                    continue;
                }

                if (frameSetup == FileIOFrameSetup.ThisFrame)
                {
                    if (currentFrame < fileAccess.firstFrameIndex || currentFrame > fileAccess.lastFrameIndex)
                    {
                        continue;
                    }
                }

                if (!m_ProfilerView.FilterActive())
                {
                    fileAccess.index = id;
                }

                var item = new FileAccessTreeViewItem(id, 0, fileAccess.filename, fileAccess);
                root.AddChild(item);
                id++;
            }

            // Return root of the tree
            return(root);
        }