From 22ee17c49fb7bd9cd57d6b4d46ad9f871fa489f5 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Tue, 5 May 2026 08:48:41 +0200 Subject: [PATCH] Insect rig improvements --- Editor/ClusterViewer.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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();