public void Push(IEnumerator coroutine, Action onFinished) { Action hook = delegate () { OnFuncEnd(); onFinished(); }; var command = new Command(coroutine, hook); CommandQueue.Enqueue(command); }
public void Update() { if (CommandQueue.Count == 0) { return; } if (CurCommand != null) { return; } CurCommand = CommandQueue.Dequeue(); CoroutineExecuter.StartCoroutine(CurCommand.Execute(CoroutineExecuter)); }
void OnFuncEnd() { CurCommand = null; }