private IEnumerator Parse(string source, float offsetY) { IEnumerator reload = null; var parser = new HTMLParser(resLoader); var parse = parser.ParseRoot( source, parsedTagTree => { if (parsedTagTree.errors.Any()) { if (onParseFailed != null) { onParseFailed(parsedTagTree.errors); } return; } reload = Load(parsedTagTree, viewRect, offsetY, eventReceiverGameObj); } ); while (parse.MoveNext()) { yield return(null); } if (reload == null) { yield break; } while (reload.MoveNext()) { yield return(null); } }