コード例 #1
0
        void TopToolBar(Rect rect)
        {
            GUILayout.BeginArea(rect);
            using (new EditorGUILayout.HorizontalScope())
            {
                var style = "miniButton";
                if (GUILayout.Button("Take Snapshot", style))
                {
                    m_Status = "Taking snapshot.....";
                    UnityEditor.MemoryProfiler.MemorySnapshot.RequestNewSnapshot();
                }

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

                if (GUILayout.Button("Save Snapshot", style))
                {
                    m_Status = "Saving snapshot.....";
                    PackedMemorySnapshotUtility.SaveToFile(_snapshot);
                }
            }

            GUILayout.EndArea();
        }
コード例 #2
0
        void TopToolBar(Rect rect)
        {
            GUILayout.BeginArea(rect);
            using (new EditorGUILayout.HorizontalScope())
            {
                var style = "miniButton";
                if (GUILayout.Button("Take Snapshot", style))
                {
                    bCheckHeapOnly = false;
                    m_Status       = "Taking snapshot.....";
                    UnityEditor.MemoryProfiler.MemorySnapshot.RequestNewSnapshot();
                }

                if (GUILayout.Button("Load Snapshot", style))
                {
                    bCheckHeapOnly = false;
                    m_Status       = "Loading snapshot.....";
                    PackedMemorySnapshot packedSnapshot = PackedMemorySnapshotUtility.LoadFromFile();
                    //Debug.Log("Unlock!!!!!!!!!!!! " + packedSnapshot);
                    if (packedSnapshot != null)
                    {
                        IncomingSnapshot(packedSnapshot);
                    }
                }

                if (_snapshot != null)
                {
                    if (GUILayout.Button("Save Snapshot", style))
                    {
                        m_Status = "Saving snapshot.....";
                        PackedMemorySnapshotUtility.SaveToFile(_snapshot);
                    }
                }

                if (_unpackedCrawl != null)
                {
#if UNITY_5_6_OR_NEWER
                    //if (bCheckHeapOnly)
                    //{

                    if (GUILayout.Button("Show Tree/Node View", style))
                    {
                        bCheckHeapOnly          = false;
                        m_nodeView.bShowMemHeap = false;
                        m_nodeView.ClearNodeView();
                        m_TreeView.Reload();
                    }

                    //}
                    //else
                    {
#endif
                    if (GUILayout.Button("Show Heap Usage", style))
                    {
                        bCheckHeapOnly = true;
                        bshowPlainData = false;
                        m_nodeView.ClearNodeView();
                        m_nodeView.CreateTreelessView(_unpackedCrawl);
                    }

                    if (GUILayout.Button("Show Plain Data", style))
                    {
                        bCheckHeapOnly = true;
                        bshowPlainData = true;
                    }
#if UNITY_5_6_OR_NEWER
                }
#endif
                }
            }

            GUILayout.EndArea();
        }
コード例 #3
0
        void TopToolBar(Rect rect)
        {
            GUILayout.BeginArea(rect);
            using (new EditorGUILayout.HorizontalScope()) {
                var style = "miniButton";
                if (GUILayout.Button("Take Snapshot", style))
                {
                    m_Status = "Taking snapshot.....";
                    UnityEditor.MemoryProfiler.MemorySnapshot.RequestNewSnapshot();
                }

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

                if (_snapshot != null)
                {
                    if (GUILayout.Button("Save Snapshot", style))
                    {
                        m_Status = "Saving snapshot.....";
                        PackedMemorySnapshotUtility.SaveToFile(_snapshot);
                    }
                }

                if (GUILayout.Button("Load CrawlerData", style))
                {
                    m_Status       = "Loading CrawlerData.....";
                    _packedCrawled = PackedMemorySnapshotUtility.LoadCrawlerDataFromFile();
                    if (null != _packedCrawled)
                    {
                        m_nodeView.ClearNodeView();
                        _snapshot                = _packedCrawled.packedMemorySnapshot;
                        _unpackedCrawl           = null;
                        _packedCrawlGenerating   = true;
                        _unpackedCrawlGenerating = false;
                    }
                }

                if (_packedCrawled != null)
                {
                    if (GUILayout.Button("Save CrawlerData", style))
                    {
                        m_Status = "Saving CrawlerData.....";
                        PackedMemorySnapshotUtility.SaveCrawlerDataToFile(_packedCrawled);
                    }
                }

                if (_unpackedCrawl != null)
                {
                    if (GUILayout.Button("Show Heap Usage", style))
                    {
                        bshowPlainData = false;
                        m_nodeView.ClearNodeView();
                        m_nodeView.CreateTreelessView(_unpackedCrawl);
                    }

                    if (GUILayout.Button("Show Plain Data", style))
                    {
                        bshowPlainData = true;
                    }
                }
            }
            GUILayout.EndArea();
        }