private void RenderWindowContents() { if (null == _currentNode) { GUILayout.Label($"Frame Time: {(int)(_lastFrameTime * 1000.0f)} ms"); GUILayout.Label($"Min Frame Time: {(int)(_minFrameTime * 1000.0f)} ms"); GUILayout.Label($"Max Frame Time: {(int)(_maxFrameTime * 1000.0f)} ms"); GUILayout.Label($"Average FPS: {(int)AverageFPS}"); _windowScrollPos = GUILayout.BeginScrollView(_windowScrollPos); foreach (DebugMenuNode node in _nodes) { node.RenderNode(); } GUILayout.EndScrollView(); if (GUIUtils.LayoutButton("Quit")) { Application.Quit(); } } else { _windowScrollPos = GUILayout.BeginScrollView(_windowScrollPos); _currentNode.RenderContents(); GUILayout.EndScrollView(); if (GUIUtils.LayoutButton("Back")) { SetCurrentNode(_currentNode.Parent); } } }
private void RenderWindowContents() { if (null == _currentNode) { _windowScrollPos = GUILayout.BeginScrollView(_windowScrollPos); foreach (DebugMenuNode node in _nodes) { node.RenderNode(); } GUILayout.EndScrollView(); if (GUILayout.Button("Quit", GUILayout.Width(100), GUILayout.Height(25))) { Application.Quit(); } } else { _windowScrollPos = GUILayout.BeginScrollView(_windowScrollPos); _currentNode.RenderContents(); GUILayout.EndScrollView(); if (GUILayout.Button("Back", GUILayout.Width(100), GUILayout.Height(25))) { SetCurrentNode(_currentNode.Parent); } } }
private void RenderWindowContents() { if (null == _currentNode) { GUILayout.Label($"Unity version: {Application.unityVersion}"); GUILayout.Label($"Random seed: {PartyParrotManager.Instance.RandomSeed}"); _showScreen = GUIUtils.Foldout(_showScreen, "Screen"); if (_showScreen) { GUILayout.BeginVertical(GUI.skin.box); GUILayout.Label($"Current Resolution: {Screen.currentResolution} ({Screen.width} x {Screen.height})"); GUILayout.Label($"Fullscreen: {Screen.fullScreen}"); GUILayout.Label($"DPI: {Screen.dpi}"); GUILayout.Label($"Orientation: {Screen.orientation}"); GUILayout.EndVertical(); } _showRendering = GUIUtils.Foldout(_showRendering, "Rendering"); if (_showRendering) { GUILayout.BeginVertical(GUI.skin.box); GUILayout.Label($"Frame Time: {(int)(_lastFrameTime * 1000.0f)} ms"); GUILayout.Label($"Min Frame Time: {(int)(_minFrameTime * 1000.0f)} ms"); GUILayout.Label($"Max Frame Time: {(int)(_maxFrameTime * 1000.0f)} ms"); GUILayout.Label($"Average FPS: {(int)AverageFPS}"); GUILayout.EndVertical(); } _showMemory = GUIUtils.Foldout(_showMemory, "Memory"); if (_showMemory) { GUILayout.BeginVertical(GUI.skin.box); GUILayout.Label($"Allocated: {Profiler.GetTotalAllocatedMemoryLong() / 1048576.0f:0.00}MB"); GUILayout.Label($"Reserved: {Profiler.GetTotalReservedMemoryLong() / 1048576.0f:0.00}MB"); GUILayout.Label($"Unused: {Profiler.GetTotalUnusedReservedMemoryLong() / 1048576.0f:0.00}MB"); GUILayout.Label($"Mono Heap: {Profiler.GetMonoHeapSizeLong() / 1048576.0f:0.00}MB"); GUILayout.Label($"Mono Used: {Profiler.GetMonoUsedSizeLong() / 1048576.0f:0.00}MB"); GUILayout.Label($"Temp Allocator Size: {Profiler.GetTempAllocatorSize() / 1048576.0f:0.00}MB"); #if UNITY_EDITOR GUILayout.Label($"GPU Allocated: {Profiler.GetAllocatedMemoryForGraphicsDriver() / 1048576.0f:0.00}MB"); #endif GUILayout.EndVertical(); } _windowScrollPos = GUILayout.BeginScrollView(_windowScrollPos); foreach (DebugMenuNode node in _nodes) { node.RenderNode(); } GUILayout.EndScrollView(); #if UNITY_EDITOR GUILayout.BeginHorizontal(); if (GUIUtils.LayoutButton("Break")) { Debug.Break(); } _frameStepping = GUILayout.Toggle(_frameStepping, "Enable Frame Stepping (Manually disable in the Hierarchy)"); // TODO: should we force select the manager for the user? GUILayout.EndHorizontal(); #endif GUILayout.BeginHorizontal(); // TODO: reloading doesn't work right (it has to be in a coroutine or something right?) /*if(GUIUtils.LayoutButton("Reload")) { * Scenes.SceneManager.Instance.ReloadMainScene(); * }*/ if (GUIUtils.LayoutButton("Quit")) { UnityUtil.Quit(); } if (GUIUtils.LayoutButton("Reset PlayerPrefs")) { PlayerPrefs.DeleteAll(); } GUILayout.EndHorizontal(); } else { _windowScrollPos = GUILayout.BeginScrollView(_windowScrollPos); _currentNode.RenderContents(); GUILayout.EndScrollView(); if (GUIUtils.LayoutButton("Back")) { SetCurrentNode(_currentNode.Parent); } } }
private void RenderWindowContents() { if (null == _currentNode) { GUILayout.Label($"Random seed: {PartyParrotManager.Instance.RandomSeed}"); GUILayout.BeginVertical("Rendering:", GUI.skin.box); GUILayout.Label($"Frame Time: {(int)(_lastFrameTime * 1000.0f)} ms"); GUILayout.Label($"Min Frame Time: {(int)(_minFrameTime * 1000.0f)} ms"); GUILayout.Label($"Max Frame Time: {(int)(_maxFrameTime * 1000.0f)} ms"); GUILayout.Label($"Average FPS: {(int)AverageFPS}"); GUILayout.EndVertical(); GUILayout.BeginVertical("Memory:", GUI.skin.box); GUILayout.Label($"Allocated: {Profiler.GetTotalAllocatedMemoryLong() / 1048576.0f:0.00}MB"); GUILayout.Label($"Reserved: {Profiler.GetTotalReservedMemoryLong() / 1048576.0f:0.00}MB"); GUILayout.Label($"Unused: {Profiler.GetTotalUnusedReservedMemoryLong() / 1048576.0f:0.00}MB"); GUILayout.Label($"Mono Heap: {Profiler.GetMonoHeapSizeLong() / 1048576.0f:0.00}MB"); GUILayout.Label($"Mono Used: {Profiler.GetMonoUsedSizeLong() / 1048576.0f:0.00}MB"); GUILayout.EndVertical(); _windowScrollPos = GUILayout.BeginScrollView(_windowScrollPos); foreach (DebugMenuNode node in _nodes) { node.RenderNode(); } GUILayout.EndScrollView(); #if UNITY_EDITOR GUILayout.BeginHorizontal(); if (GUIUtils.LayoutButton("Break")) { Debug.Break(); } _frameStepping = GUILayout.Toggle(_frameStepping, "Enable Frame Stepping (Manually disable in the Hierarchy)"); // TODO: should we force select the manager for the user? GUILayout.EndHorizontal(); #endif GUILayout.BeginHorizontal(); // TODO: reloading doesn't work right /*if(GUIUtils.LayoutButton("Reload")) { * Scenes.SceneManager.Instance.ReloadMainScene(); * }*/ if (GUIUtils.LayoutButton("Quit")) { UnityUtil.Quit(); } if (GUIUtils.LayoutButton("Reset PlayerPrefs")) { PlayerPrefs.DeleteAll(); } GUILayout.EndHorizontal(); } else { _windowScrollPos = GUILayout.BeginScrollView(_windowScrollPos); _currentNode.RenderContents(); GUILayout.EndScrollView(); if (GUIUtils.LayoutButton("Back")) { SetCurrentNode(_currentNode.Parent); } } }