diff --git a/Editor/ClusterViewer.cs b/Editor/ClusterViewer.cs index 11013d3..54df2e8 100644 --- a/Editor/ClusterViewer.cs +++ b/Editor/ClusterViewer.cs @@ -99,7 +99,9 @@ namespace NanoBrain { public void SetGraph(GameObject gameObject) { this.gameObject = gameObject; - + if (this.currentCluster == null) + return; + if (Application.isPlaying == false) this.serializedBrain = new SerializedObject(this.currentCluster.prefab); this.selectedOutput = this.currentCluster.outputs[0]; @@ -121,7 +123,7 @@ namespace NanoBrain { } public void OnIMGUI() { - if (Application.isPlaying == false) + if (Application.isPlaying == false && serializedBrain != null) serializedBrain.Update(); Handles.BeginGUI();