protected override TreeViewItem BuildRoot() { int idForhiddenRoot = -1; int depthForHiddenRoot = -1; AssetMarkerTreeViewItem root = new AssetMarkerTreeViewItem(idForhiddenRoot, depthForHiddenRoot, "root", null); AssetLoadingFrameSetup frameSetup = m_ProfilerView.GetFrameSetup(); int currentFrame = m_ProfilerView.GetSelectedFrame(); bool singleFrame = frameSetup == AssetLoadingFrameSetup.ThisFrame; var data = m_CaptureData.m_AssetLoadMarkers.OrderBy(s => s.startNs).ToList(); // reset the states foreach (var item in data) { item.addedToTreeView = false; } for (int index = 0, id = 0; index < data.Count; ++index) { CreateAndAddChild(data, root, currentFrame, singleFrame, ref index, ref id); } // Return root of the tree SetupDepthsFromParentsAndChildren(root); return(root); }
bool AssetLoadingFrameCountProfileToggle() { AssetLoadingFrameSetup oldFrameCount = selectedFrameSetup; AssetLoadingFrameSetup newFrameCount = (AssetLoadingFrameSetup)EditorGUILayout.EnumPopup(oldFrameCount, EditorStyles.toolbarDropDownLeft, GUILayout.Width(150f)); if (oldFrameCount != newFrameCount) { selectedFrameSetup = newFrameCount; } return(oldFrameCount != newFrameCount); }