void ApplyToEveryInstance(OnEachTimeFunction f) { foreach (TimeInteractable ti in TimeInteractable.AllInstances) { f(ti); } }
void TraverseAndApplyToTimeHierarchy(Transform hierarchy, OnEachTimeFunction f) { TraverseAndApplyToHierarchy(hierarchy, (transform) => { TimeInteractable timeInteractable = transform.GetComponent <TimeInteractable> (); if (timeInteractable != null) { f(timeInteractable); } }); }