From fd7359acd09c009afb877346d9e224c1a2911f8b Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Tue, 10 Feb 2026 10:08:35 +0100 Subject: [PATCH] Physics ant --- Editor/ClusterInspector.cs | 10 ++++++---- Editor/NanoBrain_Editor.cs | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Editor/ClusterInspector.cs b/Editor/ClusterInspector.cs index 4d4d941..5f81101 100644 --- a/Editor/ClusterInspector.cs +++ b/Editor/ClusterInspector.cs @@ -24,13 +24,13 @@ public class ClusterInspector : Editor { serializedObject.Update(); VisualElement root = new(); - CreateInspector(root, prefab, prefab.output); + CreateInspector(root, prefab, prefab.output, null); serializedObject.ApplyModifiedProperties(); return root; } - public static GraphView CreateInspector(VisualElement root, ClusterPrefab cluster, Nucleus output) { + public static GraphView CreateInspector(VisualElement root, ClusterPrefab cluster, Nucleus output, GameObject gameObject) { root.style.paddingLeft = 0; root.style.paddingRight = 0; root.style.paddingTop = 0; @@ -61,7 +61,7 @@ public class ClusterInspector : Editor { mainContainer.Add(inspectorContainer); root.Add(mainContainer); - graph.SetGraph(null, output, inspectorContainer); + graph.SetGraph(gameObject, output, inspectorContainer); return graph; } @@ -593,7 +593,8 @@ public class ClusterInspector : Editor { Vector3 value = synapse.nucleus.outputValue * synapse.weight; GUIContent synapseValueLabel = new(synapse.nucleus.name, synapse.nucleus.outputValue.ToString()); EditorGUILayout.FloatField(synapseValueLabel, length(synapse.nucleus.outputValue)); - } else { + } + else { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(synapse.nucleus.name); if (GUILayout.Button("Disconnect")) @@ -671,6 +672,7 @@ public class ClusterInspector : Editor { void OnSceneGUI(SceneView sceneView) { if (this.gameObject != null) { Vector3 worldVector = this.gameObject.transform.TransformVector(this.currentNucleus.outputValue); + // worldVector = worldVector.normalized; Handles.color = Color.yellow; Handles.DrawLine(this.gameObject.transform.position, this.gameObject.transform.position + worldVector); } diff --git a/Editor/NanoBrain_Editor.cs b/Editor/NanoBrain_Editor.cs index 138c901..319dc2b 100644 --- a/Editor/NanoBrain_Editor.cs +++ b/Editor/NanoBrain_Editor.cs @@ -27,7 +27,7 @@ public class NanoBrainComponent_Editor : Editor { VisualElement root = new(); - ClusterInspector.CreateInspector(root, brain.prefab, brain.output); + ClusterInspector.CreateInspector(root, brain.prefab, brain.output, component.gameObject); if (Application.isPlaying == false) serializedObject.ApplyModifiedProperties();