private void OnGUI()
        {
            Initialize();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Take Snapshot"))
            {
                UnityEditor.EditorUtility.DisplayProgressBar("Take Snapshot", "Downloading Snapshot...", 0.0f);
                try
                {
                    UnityEditor.MemoryProfiler.MemorySnapshot.RequestNewSnapshot();
                }
                finally
                {
                    EditorUtility.ClearProgressBar();
                }
            }

            EditorGUI.BeginDisabledGroup(_snapshot == null);
            if (GUILayout.Button("Save Snapshot..."))
            {
                PackedMemorySnapshotUtility.SaveToFile(_snapshot);
            }
            EditorGUI.EndDisabledGroup();

            if (GUILayout.Button("Load Snapshot..."))
            {
                PackedMemorySnapshot packedSnapshot = PackedMemorySnapshotUtility.LoadFromFile();
                if (packedSnapshot != null)
                {
                    IncomingSnapshot(packedSnapshot);
                }
            }

            GUILayout.EndHorizontal();

            if (_viewCanvas != null)
            {
                _viewCanvas.Draw();
            }

            if (_filterItems != null)
            {
                _filterItems.Draw();
            }

            if (_inspector != null)
            {
                _inspector.Draw();
            }
        }
        void OnGUI()
        {
            Initialize();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Take Snapshot"))
            {
                UnityEditor.EditorUtility.DisplayProgressBar("Take Snapshot", "Downloading Snapshot...", 0.0f);
                try
                {
                    UnityEditor.MemoryProfiler.MemorySnapshot.RequestNewSnapshot();
                }
                finally
                {
                    EditorUtility.ClearProgressBar();
                }
            }

            EditorGUI.BeginDisabledGroup(_snapshot == null);
            if (GUILayout.Button("Save Snapshot..."))
            {
                PackedMemorySnapshotUtility.SaveToFile(_snapshot);
            }
            EditorGUI.EndDisabledGroup();

            if (GUILayout.Button("Load Snapshot..."))
            {
                PackedMemorySnapshot packedSnapshot = PackedMemorySnapshotUtility.LoadFromFile();
                if (packedSnapshot != null)
                {
                    IncomingSnapshot(packedSnapshot);
                }
            }

            if (_unpackedCrawl != null)
            {
                GUILayout.Label(string.Format("Total memory: {0}", EditorUtility.FormatBytes(_unpackedCrawl.totalSize)));
            }
            GUILayout.EndHorizontal();
            if (_treeMapView != null)
            {
                _treeMapView.Draw();
            }
            if (_inspector != null)
            {
                _inspector.Draw();
            }

            //RenderDebugList();
        }
Beispiel #3
0
        void OnGUI()
        {
            Initialize();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Take Snapshot"))
            {
                UnityEditor.EditorUtility.DisplayProgressBar("Take Snapshot", "Downloading Snapshot...", 0.0f);
                UnityEditor.MemoryProfiler.MemorySnapshot.RequestNewSnapshot();
            }

            EditorGUI.BeginDisabledGroup(_snapshot == null);
            if (GUILayout.Button("Save Snapshot..."))
            {
                PackedMemorySnapshotUtility.SaveToFile(_snapshot);
            }
            EditorGUI.EndDisabledGroup();

            if (GUILayout.Button("Load Snapshot..."))
            {
                PackedMemorySnapshot packedSnapshot = PackedMemorySnapshotUtility.LoadFromFile();
                if (packedSnapshot != null)
                {
                    IncomingSnapshot(packedSnapshot);
                }
            }
            GUILayout.EndHorizontal();
            if (_treeMapView != null)
            {
                _treeMapView.Draw();
            }
            if (_inspector != null)
            {
                _inspector.Draw();
            }

            //RenderDebugList();
        }