private void DrawCPUOrRenderingToolbar(ProfilerProperty property) { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]); string[] displayedOptions = new string[] { "Hierarchy", "Timeline", "Raw Hierarchy" }; int[] optionValues = new int[] { 0, 1, 2 }; this.m_ViewType = (ProfilerViewType)EditorGUILayout.IntPopup((int)this.m_ViewType, displayedOptions, optionValues, EditorStyles.toolbarDropDown, new GUILayoutOption[] { GUILayout.Width(100f) }); GUILayout.FlexibleSpace(); GUILayout.Label(string.Format("CPU:{0}ms GPU:{1}ms", property.frameTime, property.frameGpuTime), EditorStyles.miniLabel, new GUILayoutOption[0]); GUI.enabled = (ProfilerDriver.GetNextFrameIndex(this.m_CurrentFrame) == -1); if (GUILayout.Button((!GUI.enabled) ? ProfilerWindow.ms_Styles.noFrameDebugger : ProfilerWindow.ms_Styles.frameDebugger, EditorStyles.toolbarButton, new GUILayoutOption[0])) { FrameDebuggerWindow frameDebuggerWindow = FrameDebuggerWindow.ShowFrameDebuggerWindow(); frameDebuggerWindow.EnableIfNeeded(); } GUI.enabled = true; GUILayout.FlexibleSpace(); this.SearchFieldGUI(); EditorGUILayout.EndHorizontal(); this.HandleCommandEvents(); }
public static FrameDebuggerWindow ShowFrameDebuggerWindow() { FrameDebuggerWindow frameDebuggerWindow = EditorWindow.GetWindow(typeof(FrameDebuggerWindow)) as FrameDebuggerWindow; if (frameDebuggerWindow != null) { frameDebuggerWindow.title = "Frame Debug"; frameDebuggerWindow.EnableIfNeeded(); } return(frameDebuggerWindow); }
public static FrameDebuggerWindow ShowFrameDebuggerWindow() { FrameDebuggerWindow window = EditorWindow.GetWindow(typeof(FrameDebuggerWindow)) as FrameDebuggerWindow; if (window != null) { window.titleContent = EditorGUIUtility.TextContent("Frame Debug"); window.EnableIfNeeded(); } return(window); }