public static void UnregisterFixedUpdate(IAsyncBehaviour b) { int count = fixedUpdates.Count; int i = b.fixedUpdateIndex; if (count > 1) { var toSwap = fixedUpdates[count - 1]; fixedUpdates[i] = toSwap; toSwap.fixedUpdateIndex = i; fixedUpdates.RemoveAt(count - 1); } else { fixedUpdates.RemoveAt(i); } }
public BehaviourTask(IAsyncBehaviour behaviour) { this.behaviour = behaviour; }
public static void RegisterLateUpdate(IAsyncBehaviour b) { b.lateUpdateIndex = lateUpdates.Count; lateUpdates.Add(b); }
public static void RegisterFixedUpdate(IAsyncBehaviour b) { b.fixedUpdateIndex = fixedUpdates.Count; fixedUpdates.Add(b); }
public static void RegisterUpdate(IAsyncBehaviour b) { b.updateIndex = updates.Count; updates.Add(b); }