From 97ea988ccaec3c53698d03c80810acd8fd37b5ff Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Thu, 19 Feb 2026 17:30:56 +0100 Subject: [PATCH] Fix changing weight to receptors --- Editor/ClusterInspector.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Editor/ClusterInspector.cs b/Editor/ClusterInspector.cs index b597132..0b28264 100644 --- a/Editor/ClusterInspector.cs +++ b/Editor/ClusterInspector.cs @@ -794,7 +794,17 @@ public class ClusterInspector : Editor { } EditorGUI.indentLevel++; - synapse.weight = EditorGUILayout.FloatField("Weight", synapse.weight); + float newWeight = EditorGUILayout.FloatField("Weight", synapse.weight); + if (newWeight != synapse.weight) { + if (synapse.nucleus is IReceptor receptor) { + Nucleus[] receptorArray = receptor.nucleiArray; + foreach (Synapse s in this.currentNucleus.synapses) { + if (s.nucleus is IReceptor r && r.nucleiArray == receptorArray) + s.weight = newWeight; + } + } else + synapse.weight= newWeight; + } EditorGUI.indentLevel--; } }