Beispiel #1
0
        protected void OnEnable()
        {
            this.titleContent = new GUIContent("Benchmarking");

            if (treeViewState == null)
            {
                treeViewState = new TreeViewState();
            }

            treeView = new BenchmarkingTreeView(treeViewState);
        }
Beispiel #2
0
        protected void OnGUI()
        {
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Run selected"))
            {
                Benchmark(this.treeView.GetSelectedItems());
                this.treeView.Reload();
            }
            if (GUILayout.Button("Run all"))
            {
                Benchmark(this.treeView.GetAllItems());
                this.treeView.Reload();
            }
            if (GUILayout.Button("Reload"))
            {
                this.treeViewState = new TreeViewState();
                this.treeView      = new BenchmarkingTreeView(this.treeViewState);
            }
            GUILayout.EndHorizontal();

            // Draw tree view
            treeView.OnGUI(new Rect(0, 30, position.width, position.height));
        }