Works with major scrums with many ants
This commit is contained in:
parent
19398ade98
commit
9b948fdd07
@ -413,9 +413,10 @@ public class ClusterInspector : Editor {
|
||||
Handles.DrawLine(parentPos, pos);
|
||||
if (synapse.nucleus != null) {
|
||||
Color color = Color.black;
|
||||
if (synapse.nucleus.isSleeping)
|
||||
color = Color.darkRed;
|
||||
else if (Application.isPlaying) {
|
||||
// if (synapse.nucleus.isSleeping)
|
||||
// color = Color.darkRed;
|
||||
// else
|
||||
if (Application.isPlaying) {
|
||||
float brightness = length(synapse.nucleus.outputValue) * synapse.weight / maxValue;
|
||||
color = new Color(brightness, brightness, brightness, 1f);
|
||||
}
|
||||
@ -427,9 +428,10 @@ public class ClusterInspector : Editor {
|
||||
|
||||
private void DrawNucleus(Nucleus nucleus, Vector3 position, float maxValue, float size) {
|
||||
Color color;
|
||||
if (nucleus.isSleeping)
|
||||
color = Color.darkRed;
|
||||
else {
|
||||
// if (nucleus.isSleeping)
|
||||
// color = Color.darkRed;
|
||||
// else
|
||||
{
|
||||
if (Application.isPlaying) {
|
||||
float brightness = length(nucleus.outputValue) / maxValue;
|
||||
color = new Color(brightness, brightness, brightness, 1f);
|
||||
|
||||
@ -144,7 +144,7 @@ public class Receptor : Nucleus {
|
||||
public void ProcessStimulus(Vector3 inputValue, int thingId = 0, string thingName = null) {
|
||||
CleanupReceivers();
|
||||
if (!thingReceivers.TryGetValue(thingId, out Nucleus selectedReceiver)) {
|
||||
Debug.Log($" no receiver found for {thingId}");
|
||||
//Debug.Log($" no receiver found for {thingId}");
|
||||
// No existing nucleus for this thing
|
||||
selectedReceiver = SelectReceptor(thingId, inputValue);
|
||||
}
|
||||
@ -179,7 +179,7 @@ public class Receptor : Nucleus {
|
||||
foreach (int thingId in receiversToRemove) {
|
||||
Nucleus selectedReceiver = thingReceivers[thingId];
|
||||
|
||||
Debug.Log($" removed receiver for {thingId}");
|
||||
// Debug.Log($" removed receiver for {thingId}");
|
||||
thingReceivers.Remove(thingId);
|
||||
|
||||
int colonPos = selectedReceiver.name.IndexOf(":");
|
||||
@ -197,7 +197,7 @@ public class Receptor : Nucleus {
|
||||
foreach (Nucleus receiver in this._instances) {
|
||||
if (thingReceivers.ContainsValue(receiver) == false) {
|
||||
// We found an unusued receiver
|
||||
Debug.Log($"{thingId} -> [{receiver.name}]");
|
||||
// Debug.Log($"{thingId} -> [{receiver.name}]");
|
||||
thingReceivers.Add(thingId, receiver);
|
||||
return receiver;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user