From 94df545222cfcd316e1db0c959821f3f7cb075f4 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Fri, 22 May 2026 15:21:58 +0200 Subject: [PATCH] Let go food only at home --- Editor/Cluster_Drawer.cs | 5 ++--- Runtime/Scripts/Core/Neuron.cs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Editor/Cluster_Drawer.cs b/Editor/Cluster_Drawer.cs index 709bbcc..1b6bf24 100644 --- a/Editor/Cluster_Drawer.cs +++ b/Editor/Cluster_Drawer.cs @@ -92,14 +92,13 @@ namespace NanoBrain.Unity { if (property.serializedObject.targetObjects.Length == 1) { UnityEngine.Object targetObject = property.serializedObject.targetObject; Cluster_Drawer.selectedTarget = targetObject; - + Cluster cluster; if (clusterView.initialized || Application.isPlaying) { cluster = SerializedPropertyUtility.GetManagedObjectForProperty(targetObject, property.propertyPath) as Cluster; } else { // This does not work properly yet it seems - Debug.Log("Instantiate"); ClusterPrefab clusterPrefab = prefabProp.objectReferenceValue as ClusterPrefab; cluster = new(clusterPrefab); object parent = SerializedPropertyUtility.GetParentObjectAndMember(targetObject, property.propertyPath, out var memberInfo, out int outIndex); @@ -140,7 +139,7 @@ namespace NanoBrain.Unity { } private static void OnSceneGUI(SceneView sceneView) { - if (selectedTarget == null) + if (Application.isPlaying == false || selectedTarget == null) return; GameObject gameObject = null; diff --git a/Runtime/Scripts/Core/Neuron.cs b/Runtime/Scripts/Core/Neuron.cs index 8490974..bbc267b 100644 --- a/Runtime/Scripts/Core/Neuron.cs +++ b/Runtime/Scripts/Core/Neuron.cs @@ -380,7 +380,7 @@ namespace NanoBrain { /// /// Time in seconds after the last update the neuron can go to sleep /// - public static readonly float timeToSleep = 1f; + public static readonly float timeToSleep = 0.5f; public bool breakOnUpdate = false;