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.cluster = parent;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
if (this.cluster != null)
|
if (this.cluster != null)
|
||||||
this.cluster.nuclei.Add(this);
|
this.cluster.nuclei.Add(this);
|
||||||
else
|
else
|
||||||
Debug.LogError("No prefab when adding neuron to prefab");
|
Debug.LogError("No prefab when adding neuron to prefab");
|
||||||
}
|
}
|
||||||
@ -45,9 +45,11 @@ public class Neuron : Nucleus {
|
|||||||
public CurvePresets curvePreset {
|
public CurvePresets curvePreset {
|
||||||
get { return _curvePreset; }
|
get { return _curvePreset; }
|
||||||
set {
|
set {
|
||||||
foreach (Neuron nucleus in array.nuclei.Cast<Neuron>()) {
|
if (this.array != null && this.array.nuclei != null) {
|
||||||
nucleus._curvePreset = value;
|
foreach (Neuron nucleus in this.array.nuclei.Cast<Neuron>()) {
|
||||||
nucleus.curve = GenerateCurve();
|
nucleus._curvePreset = value;
|
||||||
|
nucleus.curve = GenerateCurve();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_curvePreset = value;
|
_curvePreset = value;
|
||||||
this.curve = GenerateCurve();
|
this.curve = GenerateCurve();
|
||||||
|
|||||||
@ -13,19 +13,15 @@ public class NucleusArray {
|
|||||||
return _nuclei;
|
return _nuclei;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//public string name;
|
|
||||||
|
|
||||||
public NucleusArray(Nucleus nucleus) {
|
public NucleusArray(Nucleus nucleus) {
|
||||||
//this.name = nucleus.name;
|
|
||||||
this._nuclei = new Nucleus[1];
|
this._nuclei = new Nucleus[1];
|
||||||
this._nuclei[0] = nucleus;
|
this._nuclei[0] = nucleus;
|
||||||
}
|
}
|
||||||
public NucleusArray(ClusterPrefab cluster) {
|
public NucleusArray(ClusterPrefab cluster) {
|
||||||
//this.name = cluster.name;
|
|
||||||
this._nuclei = new Nucleus[0];
|
this._nuclei = new Nucleus[0];
|
||||||
}
|
}
|
||||||
public NucleusArray(int size, string name) {
|
public NucleusArray(int size, string name) {
|
||||||
//this.name = name;
|
|
||||||
this._nuclei = new Nucleus[size];
|
this._nuclei = new Nucleus[size];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user