Let go food only at home

This commit is contained in:
Pascal Serrarens 2026-05-22 15:21:58 +02:00
parent 62bacfb1c0
commit 94df545222
2 changed files with 3 additions and 4 deletions

View File

@ -92,14 +92,13 @@ namespace NanoBrain.Unity {
if (property.serializedObject.targetObjects.Length == 1) { if (property.serializedObject.targetObjects.Length == 1) {
UnityEngine.Object targetObject = property.serializedObject.targetObject; UnityEngine.Object targetObject = property.serializedObject.targetObject;
Cluster_Drawer.selectedTarget = targetObject; Cluster_Drawer.selectedTarget = targetObject;
Cluster cluster; Cluster cluster;
if (clusterView.initialized || Application.isPlaying) { if (clusterView.initialized || Application.isPlaying) {
cluster = SerializedPropertyUtility.GetManagedObjectForProperty(targetObject, property.propertyPath) as Cluster; cluster = SerializedPropertyUtility.GetManagedObjectForProperty(targetObject, property.propertyPath) as Cluster;
} }
else { else {
// This does not work properly yet it seems // This does not work properly yet it seems
Debug.Log("Instantiate");
ClusterPrefab clusterPrefab = prefabProp.objectReferenceValue as ClusterPrefab; ClusterPrefab clusterPrefab = prefabProp.objectReferenceValue as ClusterPrefab;
cluster = new(clusterPrefab); cluster = new(clusterPrefab);
object parent = SerializedPropertyUtility.GetParentObjectAndMember(targetObject, property.propertyPath, out var memberInfo, out int outIndex); 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) { private static void OnSceneGUI(SceneView sceneView) {
if (selectedTarget == null) if (Application.isPlaying == false || selectedTarget == null)
return; return;
GameObject gameObject = null; GameObject gameObject = null;

View File

@ -380,7 +380,7 @@ namespace NanoBrain {
/// <summary> /// <summary>
/// Time in seconds after the last update the neuron can go to sleep /// Time in seconds after the last update the neuron can go to sleep
/// </summary> /// </summary>
public static readonly float timeToSleep = 1f; public static readonly float timeToSleep = 0.5f;
public bool breakOnUpdate = false; public bool breakOnUpdate = false;