private void YieldBeingSingleton(ref BaseCyclicLoopRegistry instance) { if (_amISingleton) { _amISingleton = false; instance = null; } }
protected void Loop(ref BaseCyclicLoopRegistry singletonInstance, ref CyclicUpdateGroup group) { MakeSureGroupWasCreated(ref group); if (!_amISingleton) { if (singletonInstance == null) { _amISingleton = true; singletonInstance = this; } } if (_amISingleton) { ProcessUpdateLoop(group); } }
protected void MyOnDisable(ref BaseCyclicLoopRegistry instance) { YieldBeingSingleton(ref instance); }
public static void RegisterUpdateMethod(Action updateAction, MonoBehaviour component, float timeBetweenUpdates) { BaseCyclicLoopRegistry.RegisterUpdateMethod(updateAction, component, timeBetweenUpdates, ref _updateGroup); }
public static void RemoveUpdateMethod(Action updateAction, MonoBehaviour component) { BaseCyclicLoopRegistry.RemoveUpdateMethod(updateAction, component, ref _updateGroup); }