Sense Manager Class
public void AddSignal(Signal signal, Transform emitter){
foreach(Sensor sensor in sensors){
if (!sensor.DetectsModality(signal.modality))
continue;
float distance = Vector3.Distance(emitter.position,
sensor.transform.position);
if (signal.modality.maximumRange < distance)
continue;
float intensity = signal.strength *
Mathf.Pow(signal.modality.attenuation, distance);
if (intensity < sensor.threshold)
continue;
if (!signal.modality.ExtraTests(signal, emitter, sensor))
continue;
float time = Time.time + (distance *
signal.modality.inverseTransmissionSpeed);
Notification notification = new Notification(time, sensor, signal);
notificationQueue.Enqueue(notification, notification.time);
}
SendSignals();
}
...