Insect rig improvements

This commit is contained in:
Pascal Serrarens 2026-05-05 08:48:41 +02:00
parent b6a3bc1892
commit 22ee17c49f

View File

@ -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();