void OnDestroy() { if (TimeBetweenUpdates > 0) { CyclicUpdateRegistry.RemoveUpdateMethod(MyUpdate, this); } if (TimeBetweenLateUpdates > 0) { CyclicLateUpdateRegistry.RemoveUpdateMethod(MyLateUpdate, this); } }
void Start() { if (TimeBetweenUpdates > 0) { CyclicUpdateRegistry.RegisterUpdateMethod(MyUpdate, this, TimeBetweenUpdates); } ; if (TimeBetweenLateUpdates > 0) { CyclicLateUpdateRegistry.RegisterUpdateMethod(MyLateUpdate, this, TimeBetweenLateUpdates); } ; }