food/home steering in brain, not optimal yet
This commit is contained in:
parent
dbf24b458a
commit
42bc32c734
10
Neuron.cs
10
Neuron.cs
@ -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();
|
||||
|
||||
@ -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];
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user