private void FrameNavigationControls() { if (this.m_CurrentFrame > ProfilerDriver.lastFrameIndex) { this.SetCurrentFrameDontPause(ProfilerDriver.lastFrameIndex); } GUILayout.Label(ProfilerWindow.ms_Styles.frame, EditorStyles.miniLabel, new GUILayoutOption[0]); GUILayout.Label(" " + this.PickFrameLabel(), EditorStyles.miniLabel, new GUILayoutOption[] { GUILayout.Width(100f) }); GUI.enabled = (ProfilerDriver.GetPreviousFrameIndex(this.m_CurrentFrame) != -1); if (GUILayout.Button(ProfilerWindow.ms_Styles.prevFrame, EditorStyles.toolbarButton, new GUILayoutOption[0])) { this.PrevFrame(); } GUI.enabled = (ProfilerDriver.GetNextFrameIndex(this.m_CurrentFrame) != -1); if (GUILayout.Button(ProfilerWindow.ms_Styles.nextFrame, EditorStyles.toolbarButton, new GUILayoutOption[0])) { this.NextFrame(); } GUI.enabled = true; GUILayout.Space(10f); if (GUILayout.Button(ProfilerWindow.ms_Styles.currentFrame, EditorStyles.toolbarButton, new GUILayoutOption[0])) { this.SetCurrentFrame(-1); this.m_LastFrameFromTick = ProfilerDriver.lastFrameIndex; } }
public IEnumerator OpenProfilerReport() { ProfilerDriver.ClearAllFrames(); ProfilerDriver.profileEditor = true; yield return(null); ProfilerDriver.enabled = true; yield return(null); ProfilerDriver.enabled = false; yield return(null); var profileSaveFilePath = ProfilerHelpers.SaveProfileReport(k_ApplicationTickMarker); yield return(null); EditorWindow profilerWindow = null; ProfilerHelpers.OpenProfileReport(profileSaveFilePath, k_ApplicationTickMarker, win => { profilerWindow = win; }); yield return(TestUtils.WaitForDelayCall()); yield return(TestUtils.WaitForDelayCall()); Assert.IsNotNull(profilerWindow); File.Delete(profileSaveFilePath); profilerWindow.Close(); }
private void DrawMainToolbar() { GUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]); Rect rect = GUILayoutUtility.GetRect(ProfilerWindow.ms_Styles.addArea, EditorStyles.toolbarDropDown, new GUILayoutOption[] { GUILayout.Width(120f) }); if (EditorGUI.ButtonMouseDown(rect, ProfilerWindow.ms_Styles.addArea, FocusType.Native, EditorStyles.toolbarDropDown)) { int num = this.m_Charts.Length; string[] array = new string[num]; bool[] array2 = new bool[num]; for (int i = 0; i < num; i++) { array[i] = ((ProfilerArea)i).ToString(); array2[i] = !this.m_Charts[i].active; } EditorUtility.DisplayCustomMenu(rect, array, array2, null, new EditorUtility.SelectMenuItemFunction(this.AddAreaClick), null); } GUILayout.FlexibleSpace(); this.m_Recording = GUILayout.Toggle(this.m_Recording, ProfilerWindow.ms_Styles.profilerRecord, EditorStyles.toolbarButton, new GUILayoutOption[0]); Profiler.enabled = this.m_Recording; ProfilerWindow.SetProfileDeepScripts(GUILayout.Toggle(ProfilerDriver.deepProfiling, ProfilerWindow.ms_Styles.deepProfile, EditorStyles.toolbarButton, new GUILayoutOption[0])); ProfilerDriver.profileEditor = GUILayout.Toggle(ProfilerDriver.profileEditor, ProfilerWindow.ms_Styles.profileEditor, EditorStyles.toolbarButton, new GUILayoutOption[0]); this.m_AttachProfilerUI.OnGUILayout(this); if (GUILayout.Button(ProfilerWindow.ms_Styles.clearData, EditorStyles.toolbarButton, new GUILayoutOption[0])) { ProfilerDriver.ClearAllFrames(); } GUILayout.Space(5f); GUILayout.FlexibleSpace(); this.FrameNavigationControls(); GUILayout.EndHorizontal(); }
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(); }
void DrawHorizontalDetails() { using (var f = ProfilerDriver.GetRawFrameDataView(ProfilerWindow.GetActiveVisibleFrameIndex(), 0)) { if (f.valid) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Total Overlaps: " + GetCounterValue(f, "Overlaps"), GUILayout.Width(k_labelWidthTitle)); EditorGUILayout.LabelField("| Discreet: " + GetCounterValue(f, "Discreet Overlaps"), GUILayout.Width(k_labelWidthDetail)); EditorGUILayout.LabelField("Continuous: " + GetCounterValue(f, "Continuous Overlaps"), GUILayout.Width(k_labelWidthDetail)); EditorGUILayout.LabelField("Trigger: " + GetCounterValue(f, "Trigger Overlaps"), GUILayout.Width(k_labelWidthDetail)); EditorGUILayout.LabelField("Modified: " + GetCounterValue(f, "Modified Overlaps"), GUILayout.Width(k_labelWidthDetail)); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Broadphase Adds/Removes: " + GetCounterValue(f, "Broadphase Adds/Removes"), GUILayout.Width(k_labelWidthTitle)); EditorGUILayout.LabelField("| Adds: " + GetCounterValue(f, "Broadphase Adds"), GUILayout.Width(k_labelWidthDetail)); EditorGUILayout.LabelField("Removes: " + GetCounterValue(f, "Broadphase Removes"), GUILayout.Width(k_labelWidthDetail)); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Narrowphase Touches: " + GetCounterValue(f, "Narrowphase Touches"), GUILayout.Width(k_labelWidthTitle)); EditorGUILayout.LabelField("| New: " + GetCounterValue(f, "Narrowphase New Touches"), GUILayout.Width(k_labelWidthDetail)); EditorGUILayout.LabelField("Lost: " + GetCounterValue(f, "Narrowphase Lost Touches"), GUILayout.Width(k_labelWidthDetail)); EditorGUILayout.EndHorizontal(); } } }
private static void AddPlayerProfilers(List <ProfilerChoise> profilers) { foreach (int availableProfiler in ProfilerDriver.GetAvailableProfilers()) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type AttachProfilerUI.\u003CAddPlayerProfilers\u003Ec__AnonStoreyA8 profilersCAnonStoreyA8 = new AttachProfilerUI.\u003CAddPlayerProfilers\u003Ec__AnonStoreyA8(); // ISSUE: reference to a compiler-generated field profilersCAnonStoreyA8.guid = availableProfiler; // ISSUE: reference to a compiler-generated field string str = ProfilerDriver.GetConnectionIdentifier(profilersCAnonStoreyA8.guid); // ISSUE: reference to a compiler-generated field bool flag1 = ProfilerDriver.IsIdentifierOnLocalhost(profilersCAnonStoreyA8.guid) && str.Contains("MetroPlayerX"); // ISSUE: reference to a compiler-generated field bool flag2 = !flag1 && ProfilerDriver.IsIdentifierConnectable(profilersCAnonStoreyA8.guid); if (!flag2) { str = !flag1 ? str + " (Version mismatch)" : str + " (Localhost prohibited)"; } // ISSUE: reference to a compiler-generated method // ISSUE: reference to a compiler-generated method profilers.Add(new ProfilerChoise() { Name = str, Enabled = flag2, IsSelected = new Func <bool>(profilersCAnonStoreyA8.\u003C\u003Em__1EB), ConnectTo = new System.Action(profilersCAnonStoreyA8.\u003C\u003Em__1EC) }); } }
private static void AddPlayerProfilers(List <ProfilerChoise> profilers) { int[] availableProfilers = ProfilerDriver.GetAvailableProfilers(); for (int i = 0; i < availableProfilers.Length; i++) { int guid = availableProfilers[i]; string text = ProfilerDriver.GetConnectionIdentifier(guid); bool flag = ProfilerDriver.IsIdentifierOnLocalhost(guid) && text.Contains("MetroPlayerX"); bool flag2 = !flag && ProfilerDriver.IsIdentifierConnectable(guid); if (!flag2) { if (flag) { text += " (Localhost prohibited)"; } else { text += " (Version mismatch)"; } } profilers.Add(new ProfilerChoise { Name = text, Enabled = flag2, IsSelected = () => ProfilerDriver.connectedProfiler == guid, ConnectTo = delegate { ProfilerDriver.connectedProfiler = guid; } }); } }
private Texture2D GenerateTagTexture(TagInfo info, int idx) { Texture2D texture = null; for (int i = idx; i < idx + 10; ++i) { HierarchyFrameDataView hierarchyFrameDataView = ProfilerDriver.GetHierarchyFrameDataView(i, 0, HierarchyFrameDataView.ViewModes.Default, 0, false); if (hierarchyFrameDataView == null) { continue; } NativeArray <byte> bytes = hierarchyFrameDataView.GetFrameMetaData <byte>(ScreenShotToProfiler.MetadataGuid, info.id); if (bytes.IsCreated && bytes.Length > 16) { texture = new Texture2D(info.width, info.height, TextureFormat.RGBA32, false); texture.LoadRawTextureData(bytes); texture.Apply(); break; } } return(texture); }
public static void OpenProfileReport(string profileDataPath, string searchString = "", Action <EditorWindow> onProfileReportLoaded = null) { var profilerWindow = OpenProfilerWindow(); EditorApplication.delayCall += () => { EnableProfiler(false); ProfilerDriver.ClearAllFrames(); if (ProfilerDriver.LoadProfile(profileDataPath, false)) { profilerWindow.titleContent.text = System.IO.Path.GetFileNameWithoutExtension(profileDataPath); } SwitchToCPUView(profilerWindow); profilerWindow.Repaint(); if (!string.IsNullOrEmpty(searchString)) { EditorApplication.delayCall += () => { // Wait till switch to CPU before setting the search field. SetSearchField(profilerWindow, searchString); Debug.Log("Profiler report ready"); profilerWindow.Repaint(); }; } onProfileReportLoaded?.Invoke(profilerWindow); }; }
private void OnGUI() { EditorGUILayout.BeginVertical(); EditorGUILayout.LabelField("Current Target: " + ProfilerDriver.GetConnectionIdentifier(ProfilerDriver.connectedProfiler)); if (GUILayout.Button("Take Sample")) { TakeSample(); } _memorySize = EditorGUILayout.FloatField("Memory Size(MB) >= ", _memorySize); _memoryDepth = EditorGUILayout.IntField("Memory Depth(>=1)", _memoryDepth); if (GUILayout.Button("Extract Memory")) { if (_memoryDepth <= 0) { _memoryDepth = 1; } ExtractMemory(_memorySize, _memoryDepth - 1); } EditorGUILayout.BeginVertical(); }
private void DoActiveProfilerButton(Rect position) { if (!EditorGUI.ButtonMouseDown(position, new GUIContent("Active Profler"), FocusType.Native, EditorStyles.toolbarDropDown)) { return; } int connectedProfiler = ProfilerDriver.connectedProfiler; this.connectionGuids = ProfilerDriver.GetAvailableProfilers(); int length = this.connectionGuids.Length; int[] selected = new int[1]; bool[] enabled = new bool[length]; string[] options = new string[length]; for (int index = 0; index < length; ++index) { int connectionGuid = this.connectionGuids[index]; bool flag = ProfilerDriver.IsIdentifierConnectable(connectionGuid); enabled[index] = flag; string connectionIdentifier = ProfilerDriver.GetConnectionIdentifier(connectionGuid); if (!flag) { connectionIdentifier += " (Version mismatch)"; } options[index] = connectionIdentifier; if (connectionGuid == connectedProfiler) { selected[0] = index; } } EditorUtility.DisplayCustomMenu(position, options, enabled, selected, new EditorUtility.SelectMenuItemFunction(this.SelectProfilerClick), (object)null); }
public static void DirectURLConnect(string url) { ConsoleWindow.ShowConsoleWindow(true); AttachProfilerUI.ms_NotificationMessage = new GUIContent("Connecting to player...(this can take a while)"); ProfilerDriver.DirectURLConnect(url); AttachProfilerUI.ms_NotificationMessage = null; }
public static void DirectIPConnect(string ip) { ConsoleWindow.ShowConsoleWindow(true); AttachProfilerUI.ms_NotificationMessage = EditorGUIUtility.TrTextContent("Connecting to player...(this can take a while)", null, null); ProfilerDriver.DirectIPConnect(ip); AttachProfilerUI.ms_NotificationMessage = null; }
public void OnGUI() { GUIContent content = EditorGUIUtility.TextContent(this.GetConnectedProfiler() + "|Specifies the target player for receiving profiler and log data."); Vector2 vector = EditorStyles.toolbarDropDown.CalcSize(content); Rect rect = GUILayoutUtility.GetRect(vector.x, vector.y); if (EditorGUI.DropdownButton(rect, content, FocusType.Passive, EditorStyles.toolbarDropDown)) { List <ProfilerChoise> list = new List <ProfilerChoise>(); list.Clear(); AttachProfilerUI.AddPlayerProfilers(list); AttachProfilerUI.AddDeviceProfilers(list); AttachProfilerUI.AddLastIPProfiler(list); if (!ProfilerDriver.IsConnectionEditor()) { if (!list.Any((ProfilerChoise p) => p.IsSelected())) { List <ProfilerChoise> arg_10B_0 = list; ProfilerChoise item = default(ProfilerChoise); item.Name = "(Autoconnected Player)"; item.Enabled = false; item.IsSelected = (() => true); item.ConnectTo = delegate { }; arg_10B_0.Add(item); } } this.AddEnterIPProfiler(list, GUIUtility.GUIToScreenRect(rect)); this.OnGUIMenu(rect, list); } }
private void FrameNavigationControls() { if (m_CurrentFrame > ProfilerDriver.lastFrameIndex) { SetCurrentFrameDontPause(ProfilerDriver.lastFrameIndex); } // Frame number GUILayout.Label(Styles.frame, EditorStyles.miniLabel); GUILayout.Label(" " + PickFrameLabel(), EditorStyles.miniLabel, GUILayout.Width(100)); // Previous/next/current buttons GUI.enabled = ProfilerDriver.GetPreviousFrameIndex(m_CurrentFrame) != -1; if (GUILayout.Button(Styles.prevFrame, EditorStyles.toolbarButton)) { PrevFrame(); } GUI.enabled = ProfilerDriver.GetNextFrameIndex(m_CurrentFrame) != -1; if (GUILayout.Button(Styles.nextFrame, EditorStyles.toolbarButton)) { NextFrame(); } GUI.enabled = true; GUILayout.Space(10); if (GUILayout.Button(Styles.currentFrame, EditorStyles.toolbarButton)) { SetCurrentFrame(-1); m_LastFrameFromTick = ProfilerDriver.lastFrameIndex; } }
public void AddItem(ConnectionDropDownItem connectionDropDownItem) { // *begin-nonstandard-formatting* connectionItems ??= new List <ConnectionDropDownItem>(); // *end-nonstandard-formatting* // this is a hack to show switch connected over ethernet in devices if (connectionDropDownItem.IP == "127.0.0.1" && ProfilerDriver.GetConnectionIdentifier(connectionDropDownItem.m_ConnectionId).StartsWith("Switch")) { connectionDropDownItem.m_TopLevelGroup = ConnectionDropDownItem.ConnectionMajorGroup.Local; connectionDropDownItem.m_SubGroup = "Devices"; connectionDropDownItem.IsDevice = true; connectionDropDownItem.IconContent = ConnectionUIHelper.GetIcon("Switch"); var fullName = ProfilerDriver.GetConnectionIdentifier(connectionDropDownItem.m_ConnectionId); var start = fullName.IndexOf('-') + 1; var end = fullName.IndexOf('('); connectionDropDownItem.DisplayName = $"{fullName.Substring(start, end - start)} - {ProfilerDriver.GetProjectName(connectionDropDownItem.m_ConnectionId)}"; } var dupes = connectionItems.FirstOrDefault(x => x.DisplayName == connectionDropDownItem.DisplayName && x.IP == connectionDropDownItem.IP && x.Port == connectionDropDownItem.Port); if (dupes != null) { connectionItems.Remove(dupes); } connectionItems.Add(connectionDropDownItem); }
public void PollProfilerWindowMarkerName() { #if !UNITY_2021_1_OR_NEWER if (m_ProfilerWindow != null) { var timeLineGUI = GetTimeLineGUI(); if (timeLineGUI != null && m_SelectedEntryFieldInfo != null) { var selectedEntry = m_SelectedEntryFieldInfo.GetValue(timeLineGUI); if (selectedEntry != null && m_SelectedNameFieldInfo != null) { string threadGroupName = null; string threadName = null; #if UNITY_2020_1_OR_NEWER if (m_SelectedFrameIdFieldInfo != null && m_SelectedThreadIndexFieldInfo != null) { using (RawFrameDataView frameData = ProfilerDriver.GetRawFrameDataView((int)m_SelectedFrameIdFieldInfo.GetValue(selectedEntry), (int)m_SelectedThreadIndexFieldInfo.GetValue(selectedEntry))) { if (frameData != null && frameData.valid) { threadGroupName = frameData.threadGroupName; threadName = frameData.threadName; } } } #endif selectedMarkerChanged(m_SelectedNameFieldInfo.GetValue(selectedEntry).ToString(), threadGroupName, threadName); } } } #endif }
public void SetupTest() { ProfilerDriver.ClearAllFrames(); m_SetupData = new FrameSetupData(1, 300, -1, new List <string> { "1:Main Thread" }); }
internal static string GetConnectionName(int guid) { // Connection identifier is constructed in the PlayerConnection::ConstructWhoamiString() // in a form "{platform name}(host name or ip)[:port] var name = ProfilerDriver.GetConnectionIdentifier(guid); // Ignore Editor connections which named explicitly after project name. var portSpacerIndex = name.LastIndexOf(')'); if (portSpacerIndex == -1) { return(name); } // Port already specified if (name.Length > (portSpacerIndex + 1) && name[portSpacerIndex + 1] == ':') { return(name); } // If port hasn't been specified in the connection identifier, we place it with "host name or ip" segment. var port = ProfilerDriver.GetConnectionPort(guid); return(string.Format("{0}:{1})", name.Substring(0, portSpacerIndex), port)); }
private void Reflesh(int frameIdx, bool force = false) { if (lastPreviewFrameIdx == frameIdx && !force) { return; } HierarchyFrameDataView hierarchyFrameDataView = ProfilerDriver.GetHierarchyFrameDataView(frameIdx, 0, HierarchyFrameDataView.ViewModes.Default, 0, false);; NativeArray <byte> bytes = hierarchyFrameDataView.GetFrameMetaData <byte>(ScreenShotToProfiler.MetadataGuid, ScreenShotToProfiler.InfoTag); if (bytes != null && bytes.Length >= 12) { var tagInfo = GenerateTagInfo(bytes); SetOutputSize(tagInfo); if (originTexture) { Object.DestroyImmediate(originTexture); } originTexture = GenerateTagTexture(tagInfo, frameIdx); //this.drawTextureInfo.SetupToRenderTexture(originTexture); } else { //this.drawTextureInfo.SetupToRenderTexture(null); if (originTexture) { Object.DestroyImmediate(originTexture); } originTexture = null; } lastPreviewFrameIdx = frameIdx; }
IEnumerator Start() { var profilerWindowType = typeof(EditorApplication).Assembly.GetType("UnityEditor.ProfilerWindow"); ProfilerDriver.ClearAllFrames(); // Skip first frame stutter #if UNITY_2017_3_OR_NEWER ProfilerDriver.enabled = false; #endif yield return(null); #if UNITY_2017_3_OR_NEWER ProfilerDriver.enabled = true; #endif if (showProfilerWindow) { var window = EditorWindow.GetWindow(profilerWindowType); window.maximized = true; } while (playableDirector.playableGraph.IsValid() && playableDirector.playableGraph.IsPlaying()) { yield return(null); } #if UNITY_2017_3_OR_NEWER ProfilerDriver.enabled = false; #endif EditorApplication.isPlaying = false; }
static void AddPlayerProfilers(List <ProfilerChoise> profilers) { int[] connectionGuids = ProfilerDriver.GetAvailableProfilers(); for (int index = 0; index < connectionGuids.Length; index++) { int guid = connectionGuids[index]; string name = ProfilerDriver.GetConnectionIdentifier(guid); bool isProhibited = ProfilerDriver.IsIdentifierOnLocalhost(guid) && name.Contains("MetroPlayerX"); bool enabled = !isProhibited && ProfilerDriver.IsIdentifierConnectable(guid); if (!enabled) { if (isProhibited) { name += " (Localhost prohibited)"; } else { name += " (Version mismatch)"; } } profilers.Add(new ProfilerChoise() { Name = name, Enabled = enabled, IsSelected = () => { return(ProfilerDriver.connectedProfiler == guid); }, ConnectTo = () => { ProfilerDriver.connectedProfiler = guid; } }); } }
public int ExecuteOnFoundProfilerFrame(string frameContains, int threadIndex, int startFrame, int lastFrameIndex, Action <HierarchyFrameDataView, int, int> executeOnceFound) { for (var frameIndex = startFrame; frameIndex <= lastFrameIndex; frameIndex++) { using (var frameData = ProfilerDriver.GetHierarchyFrameDataView(frameIndex, threadIndex, HierarchyFrameDataView.ViewModes.Default, HierarchyFrameDataView.columnSelfPercent, false)) { var rootId = frameData.GetRootItemID(); if (rootId != -1) { var matchingItemId = GetItemIdMatchingRecursive(frameData, rootId, (name) => name.Contains(frameContains)); if (matchingItemId != -1) { LastFoundAtFrameIndex = frameIndex; executeOnceFound(frameData, matchingItemId, frameIndex); return(matchingItemId); } } } } return(-1); }
private void SelectProfilerClick(object userData, string[] options, int selected) { int num = this.connectionGuids[selected]; this.lastOpenedProfiler = ProfilerDriver.GetConnectionIdentifier(num); ProfilerDriver.connectedProfiler = num; }
private void DoActiveProfilerButton(Rect position) { if (EditorGUI.ButtonMouseDown(position, new GUIContent("Active Profler"), FocusType.Native, EditorStyles.toolbarDropDown)) { int connectedProfiler = ProfilerDriver.connectedProfiler; this.connectionGuids = ProfilerDriver.GetAvailableProfilers(); int num = this.connectionGuids.Length; int[] array = new int[1]; bool[] array2 = new bool[num]; string[] array3 = new string[num]; for (int i = 0; i < num; i++) { int num2 = this.connectionGuids[i]; bool flag = ProfilerDriver.IsIdentifierConnectable(num2); array2[i] = flag; string text = ProfilerDriver.GetConnectionIdentifier(num2); if (!flag) { text += " (Version mismatch)"; } array3[i] = text; if (num2 == connectedProfiler) { array[0] = i; } } EditorUtility.DisplayCustomMenu(position, array3, array2, array, new EditorUtility.SelectMenuItemFunction(this.SelectProfilerClick), null); } }
public void LoadCounters(out SortedDictionary <string, List <string> > systemCounters, out SortedDictionary <string, List <string> > userCounters) { userCounters = new SortedDictionary <string, List <string> >(); systemCounters = new SortedDictionary <string, List <string> >(); using (var frameData = ProfilerDriver.GetRawFrameDataView(ProfilerDriver.lastFrameIndex, 0)) { if (frameData.valid) { var markers = new List <FrameDataView.MarkerInfo>(); frameData.GetMarkers(markers); foreach (var markerInfo in markers) { if ((markerInfo.flags & MarkerFlags.Counter) == 0) { continue; } var counterName = markerInfo.name; var categoryInfo = frameData.GetCategoryInfo(markerInfo.category); var categoryName = categoryInfo.name; if ((markerInfo.flags & MarkerFlags.Script) != 0) { AddToCountersCollection(categoryName, counterName, userCounters); } else { AddToCountersCollection(categoryName, counterName, systemCounters); } } } } }
static void SetupProfiledConnection(int connId, bool recording, bool isPlaying) { ProfilerDriver.connectedProfiler = ProfilerDriver.GetAvailableProfilers().FirstOrDefault(id => id == connId); ProfilerDriver.profileEditor = !isPlaying; s_SlaveProfilerWindow.SetRecordingEnabled(recording); s_SlaveProfilerWindow.Repaint(); EditorApplication.UpdateMainWindowTitle(); }
internal static void DirectURLConnect(string url) { // Profiler.DirectURLConnect is a blocking call, so a notification message is used to show the progress s_NotificationMessage = Content.ConnectingToPlayerMessage; ProfilerDriver.DirectURLConnect(url); s_NotificationMessage = null; SuccessfullyConnectedToPlayer(url); }
public static void DirectURLConnect(string url) { // Profiler.DirectURLConnect is a blocking call, so a notification message and the console are used to show progress ConsoleWindow.ShowConsoleWindow(true); ms_NotificationMessage = EditorGUIUtility.TrTextContent("Connecting to player...(this can take a while)"); ProfilerDriver.DirectURLConnect(url); ms_NotificationMessage = null; }
static void SetupProfiledConnection(int connId) { ProfilerDriver.connectedProfiler = ProfilerDriver.GetAvailableProfilers().FirstOrDefault(id => id == connId); Menu.SetChecked("Edit/Record", s_SlaveProfilerWindow.IsRecording()); Menu.SetChecked("Edit/Deep Profiling", ProfilerDriver.deepProfiling); EditorApplication.UpdateMainWindowTitle(); s_SlaveProfilerWindow.Repaint(); }