public void InitializeExecuteActions() { ITaskExecutor taskQueue = new ExecutionQueue(); int counter = 0; taskQueue.Start(); taskQueue.Add((e) => { counter++; }); taskQueue.Add((e) => { if (counter == 1) { counter++; } }); taskQueue.Add((e) => { if (counter == 2) { counter++; } }); // complete all tasks: taskQueue.Stop(true); Assert.AreEqual(3, counter, "3 Tasks should perform their job!"); }
public IRemoteObject Handle(AsyncUserToken token, IRemoteObject request) { #if UNITY_EDITOR try { #endif Handle(request as T); #if UNITY_EDITOR } catch (Exception e) { executionQueue.Add(() => Debug.Log("Izuzetak: " + e.Message)); } #endif return(null); }