Fix changing weight to receptors
This commit is contained in:
parent
f9ce73fd7a
commit
97ea988cca
@ -794,7 +794,17 @@ public class ClusterInspector : Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EditorGUI.indentLevel++;
|
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--;
|
EditorGUI.indentLevel--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user