Fix cluster instance count always 1

This commit is contained in:
Pascal Serrarens 2026-08-12 17:10:16 +02:00
parent a4776f9dea
commit 95a63d9f2d

View File

@ -184,16 +184,17 @@ namespace NanoBrain {
if (synapseData.clusterName != this.name) {
// Add reference to external cluster
// Do we know the external cluster already?
ExternalClusterData externalClusterData = clusterData.GetCluster(synapseData.clusterName);
Cluster extCluster = this.GetCluster(synapseData.clusterName);
if (extCluster == null) {
// if not: create new external cluster
Debug.Log("New ext cluster");
ExternalClusterData externalClusterData = clusterData.GetCluster(synapseData.clusterName);
ClusterPrefab extPrefab = Resources.Load(externalClusterData.prefabName) as ClusterPrefab;
extCluster = new(extPrefab, this, instanceCount) {
name = externalClusterData.name
};
}
extCluster.instanceCount = externalClusterData.instanceCount;
// Do we have the synapse already?
Neuron extNeuron = extCluster.GetNeuron(synapseData.neuronName);
Synapse synapse = receiver.GetSynapse(extNeuron); //extCluster, synapseData.neuronName);