diff --git a/Editor/ClusterPrefab_Drawer.cs b/Editor/ClusterPrefab_Drawer.cs index 41f4690..37bcd01 100644 --- a/Editor/ClusterPrefab_Drawer.cs +++ b/Editor/ClusterPrefab_Drawer.cs @@ -19,7 +19,7 @@ namespace NanoBrain.Unity { public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { float height = EditorGUIUtility.singleLineHeight + padding; - string key = property.propertyPath + "_" + property.serializedObject.targetObject.GetEntityId(); + string key = property.propertyPath + "_" + property.serializedObject.targetObject.GetInstanceID();//GetEntityId(); s_foldouts.TryGetValue(key, out bool isOpen); if (property.objectReferenceValue != null && isOpen) { height += padding + elementHeight; @@ -45,7 +45,7 @@ namespace NanoBrain.Unity { if (property.objectReferenceValue is ClusterPrefab prefab) { // key per field instance - string key = property.propertyPath + "_" + property.serializedObject.targetObject.GetEntityId(); + string key = property.propertyPath + "_" + property.serializedObject.targetObject.GetInstanceID();//GetEntityId(); if (!s_foldouts.TryGetValue(key, out bool isOpen)) isOpen = true; diff --git a/Editor/ClusterPrefab_Drawer.cs.meta b/Editor/ClusterPrefab_Drawer.cs.meta index 5e136a0..6e85a28 100644 --- a/Editor/ClusterPrefab_Drawer.cs.meta +++ b/Editor/ClusterPrefab_Drawer.cs.meta @@ -1,2 +1,11 @@ fileFormatVersion: 2 -guid: 5f43b401b7d59dec7ac7d493cbc4927d \ No newline at end of file +guid: 5f43b401b7d59dec7ac7d493cbc4927d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/ClusterView.cs b/Editor/ClusterView.cs index 1dcec7a..5ccef99 100644 --- a/Editor/ClusterView.cs +++ b/Editor/ClusterView.cs @@ -19,13 +19,13 @@ namespace NanoBrain.Unity { static readonly Dictionary clusterViews = new(); public static ClusterView GetClusterView(SerializedProperty property) { - string key = property.propertyPath + "_" + property.serializedObject.targetObject.GetEntityId(); + string key = property.propertyPath + "_" + property.serializedObject.targetObject.GetInstanceID();//GetEntityId(); if (!clusterViews.TryGetValue(key, out ClusterView clusterView)) clusterView = new() { key = key }; return clusterView; } public static ClusterView GetClusterView(SerializedObject serializedObject) { - string key = serializedObject.targetObject.GetEntityId().ToString(); + string key = serializedObject.targetObject.GetInstanceID().ToString(); //GetEntityId().ToString(); if (!clusterViews.TryGetValue(key, out ClusterView clusterView)) clusterView = new() { key = key }; return clusterView; @@ -267,6 +267,9 @@ namespace NanoBrain.Unity { private void DescendGraph(Dag.Node receiver, ref int ix, Dag dag) { Neuron receiverNeuron = receiver.nucleus as Neuron; + if (receiverNeuron == null) + return; + foreach (Synapse synapse in receiverNeuron.synapses) { Nucleus nucleus = synapse.neuron; if (nucleus.parent != null && nucleus.parent != currentNucleus.parent) { diff --git a/Editor/ClusterView.cs.meta b/Editor/ClusterView.cs.meta index 25d397c..5f8d870 100644 --- a/Editor/ClusterView.cs.meta +++ b/Editor/ClusterView.cs.meta @@ -1,2 +1,11 @@ fileFormatVersion: 2 -guid: 8a7663ccd347fd78dbdba393c03ed7c7 \ No newline at end of file +guid: 8a7663ccd347fd78dbdba393c03ed7c7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Dag.cs.meta b/Editor/Dag.cs.meta index 03066bc..8cffb37 100644 --- a/Editor/Dag.cs.meta +++ b/Editor/Dag.cs.meta @@ -1,2 +1,11 @@ fileFormatVersion: 2 -guid: a755ac8461bd0c714a852df47331048e \ No newline at end of file +guid: a755ac8461bd0c714a852df47331048e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples/Braitenberg/Scripts/LightSensor.cs b/Samples/Braitenberg/Scripts/LightSensor.cs index bf9c9fe..3177bd2 100644 --- a/Samples/Braitenberg/Scripts/LightSensor.cs +++ b/Samples/Braitenberg/Scripts/LightSensor.cs @@ -15,7 +15,7 @@ namespace NanoBrain.Braitenberg { protected override float SampleSensor() { float sum = 0f; // Get all active lights in scene (Point lights only) - Light[] lights = FindObjectsByType(); + Light[] lights = FindObjectsByType(FindObjectsSortMode.None); Vector3 pos = transform.position; Vector3 forward = transform.forward; diff --git a/Samples/Braitenberg/Scripts/LightSensor.cs.meta b/Samples/Braitenberg/Scripts/LightSensor.cs.meta index d4c4e86..9469243 100644 --- a/Samples/Braitenberg/Scripts/LightSensor.cs.meta +++ b/Samples/Braitenberg/Scripts/LightSensor.cs.meta @@ -1,2 +1,11 @@ fileFormatVersion: 2 -guid: fbdba2c00e2271d7eae755fa49a7958c \ No newline at end of file +guid: fbdba2c00e2271d7eae755fa49a7958c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples/Braitenberg/Scripts/Motor.cs.meta b/Samples/Braitenberg/Scripts/Motor.cs.meta index 19b081f..b124b9f 100644 --- a/Samples/Braitenberg/Scripts/Motor.cs.meta +++ b/Samples/Braitenberg/Scripts/Motor.cs.meta @@ -1,2 +1,11 @@ fileFormatVersion: 2 -guid: 07c6bf9674b9f9f0bbbf4a37f570ef4d \ No newline at end of file +guid: 07c6bf9674b9f9f0bbbf4a37f570ef4d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples/Braitenberg/Scripts/Sensor.cs.meta b/Samples/Braitenberg/Scripts/Sensor.cs.meta index 7702dd8..9ca6e98 100644 --- a/Samples/Braitenberg/Scripts/Sensor.cs.meta +++ b/Samples/Braitenberg/Scripts/Sensor.cs.meta @@ -1,2 +1,11 @@ fileFormatVersion: 2 -guid: b3d0457beca5df1bba076ac65df90b59 \ No newline at end of file +guid: b3d0457beca5df1bba076ac65df90b59 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples/Braitenberg/Scripts/Vehicle.cs.meta b/Samples/Braitenberg/Scripts/Vehicle.cs.meta index e2b64cb..c0a6195 100644 --- a/Samples/Braitenberg/Scripts/Vehicle.cs.meta +++ b/Samples/Braitenberg/Scripts/Vehicle.cs.meta @@ -1,2 +1,11 @@ fileFormatVersion: 2 -guid: a8d53357b6673864d91bbc5c595d48b9 \ No newline at end of file +guid: a8d53357b6673864d91bbc5c595d48b9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: