private void Start() { // Attampt to bind onto the distance active callback foreach (Rigidbody rb in velocityPoints) { DistanceFrom df = rb.GetComponent <DistanceFrom>(); if (df != null) { df.ActiveDistance += DistanceActive; } } }
void DistanceActive(bool active, DistanceFrom distFrom) { activeCount += active ? 1 : -1; }