private static IEnumerator _RunOnDelegate(Run aRun, SimpleEvent aDelegate, System.Action aAction) { aRun.isDone = false; System.Action action = () => { aAction(); }; aDelegate.Add(action); while (!aRun.abort && aAction != null) { yield return(null); } aDelegate.Remove(action); aRun.isDone = true; }
private static IEnumerator _RunOnDelegate(Run aRun, SimpleEvent aDelegate, System.Action aAction) { aRun.isDone = false; System.Action action = () => { aAction(); }; aDelegate.Add(action); while (!aRun.abort && aAction != null) { yield return null; } aDelegate.Remove(action); aRun.isDone = true; }