food/home steering in brain, not optimal yet

This commit is contained in:
Pascal Serrarens 2026-02-11 17:03:37 +01:00
parent dbf24b458a
commit 42bc32c734
2 changed files with 6 additions and 8 deletions

View File

@ -18,7 +18,7 @@ public class Neuron : Nucleus {
this.cluster = parent;
this.name = name;
if (this.cluster != null)
this.cluster.nuclei.Add(this);
this.cluster.nuclei.Add(this);
else
Debug.LogError("No prefab when adding neuron to prefab");
}
@ -45,9 +45,11 @@ public class Neuron : Nucleus {
public CurvePresets curvePreset {
get { return _curvePreset; }
set {
foreach (Neuron nucleus in array.nuclei.Cast<Neuron>()) {
nucleus._curvePreset = value;
nucleus.curve = GenerateCurve();
if (this.array != null && this.array.nuclei != null) {
foreach (Neuron nucleus in this.array.nuclei.Cast<Neuron>()) {
nucleus._curvePreset = value;
nucleus.curve = GenerateCurve();
}
}
_curvePreset = value;
this.curve = GenerateCurve();

View File

@ -13,19 +13,15 @@ public class NucleusArray {
return _nuclei;
}
}
//public string name;
public NucleusArray(Nucleus nucleus) {
//this.name = nucleus.name;
this._nuclei = new Nucleus[1];
this._nuclei[0] = nucleus;
}
public NucleusArray(ClusterPrefab cluster) {
//this.name = cluster.name;
this._nuclei = new Nucleus[0];
}
public NucleusArray(int size, string name) {
//this.name = name;
this._nuclei = new Nucleus[size];
}