improved pheromone steering
This commit is contained in:
parent
f40d1ea4ae
commit
2af597fbdb
@ -572,13 +572,18 @@ public class ClusterInspector : Editor {
|
|||||||
if (showSynapses) {
|
if (showSynapses) {
|
||||||
|
|
||||||
anythingChanged = ConnectNucleus(this.prefab, this.currentNucleus);
|
anythingChanged = ConnectNucleus(this.prefab, this.currentNucleus);
|
||||||
AddSynapse(this.prefab, this.currentNucleus);
|
anythingChanged = AddSynapse(this.prefab, this.currentNucleus);
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
if (this.currentNucleus is Neuron neuron2)
|
if (this.currentNucleus is Neuron neuron2) {
|
||||||
neuron2.combinator = (Neuron.CombinatorType)EditorGUILayout.EnumPopup("Combinator", neuron2.combinator);
|
Neuron.CombinatorType newCombinator = (Neuron.CombinatorType)EditorGUILayout.EnumPopup("Combinator", neuron2.combinator);
|
||||||
|
anythingChanged |= newCombinator != neuron2.combinator;
|
||||||
|
neuron2.combinator = newCombinator;
|
||||||
|
}
|
||||||
|
|
||||||
this.currentNucleus.bias = EditorGUILayout.Vector3Field("Bias", this.currentNucleus.bias);
|
Vector3 newBias = EditorGUILayout.Vector3Field("Bias", this.currentNucleus.bias);
|
||||||
|
anythingChanged |= newBias != this.currentNucleus.bias;
|
||||||
|
this.currentNucleus.bias = newBias;
|
||||||
|
|
||||||
NucleusArray array = null;
|
NucleusArray array = null;
|
||||||
if (this.currentNucleus.synapses.Count > 0) {
|
if (this.currentNucleus.synapses.Count > 0) {
|
||||||
@ -682,10 +687,11 @@ public class ClusterInspector : Editor {
|
|||||||
|
|
||||||
void OnSceneGUI(SceneView sceneView) {
|
void OnSceneGUI(SceneView sceneView) {
|
||||||
if (this.gameObject != null) {
|
if (this.gameObject != null) {
|
||||||
Vector3 worldVector = this.gameObject.transform.TransformVector(this.currentNucleus.outputValue);
|
foreach (Nucleus nucleus in this.currentNucleus.array.nuclei) {
|
||||||
// worldVector = worldVector.normalized;
|
Vector3 worldVector = this.gameObject.transform.TransformVector(nucleus.outputValue);
|
||||||
Handles.color = Color.yellow;
|
Handles.color = Color.yellow;
|
||||||
Handles.DrawLine(this.gameObject.transform.position, this.gameObject.transform.position + worldVector);
|
Handles.DrawLine(this.gameObject.transform.position, this.gameObject.transform.position + worldVector);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -824,17 +830,16 @@ public class ClusterInspector : Editor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void AddSynapse(ClusterPrefab cluster, Nucleus nucleus) {
|
protected virtual bool AddSynapse(ClusterPrefab cluster, Nucleus nucleus) {
|
||||||
if (cluster == null)
|
if (cluster == null)
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
//string[] options = { "Neuron", "MemoryCell", "Selector", "Cluster" };
|
|
||||||
//int selectedInputType = -1;
|
|
||||||
//selectedInputType = EditorGUILayout.Popup("Add", selectedInputType, options);
|
|
||||||
//if (selectedInputType >= 0)
|
|
||||||
Nucleus.Type selectedType = (Nucleus.Type)EditorGUILayout.EnumPopup("Add", Nucleus.Type.None);
|
Nucleus.Type selectedType = (Nucleus.Type)EditorGUILayout.EnumPopup("Add", Nucleus.Type.None);
|
||||||
if (selectedType != Nucleus.Type.None)
|
if (selectedType == Nucleus.Type.None)
|
||||||
AddInput(selectedType, this.currentNucleus);
|
return false;
|
||||||
|
|
||||||
|
AddInput(selectedType, this.currentNucleus);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void DisconnectNucleus(Neuron nucleus) {
|
protected virtual void DisconnectNucleus(Neuron nucleus) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user