/// <summary> /// 提供一个静态的方法 /// 需要用MonoBehaviour.StartCoroutine来执行 /// </summary> /// <param name="work"></param> /// <returns></returns> public static IEnumerator Execute(Action work) { var ad = new AsyncDelegate(work); ad.Start(); while (!ad.IsDone) { yield return(null); } }
public AsyncDelegate AsyncReloadDataFromTextResources(string path, int editionType, bool crypto) { AsyncDelegate ad = new AsyncDelegate( delegate(){ ReloadDataFromFile(path, editionType, crypto); } ); ad.Start(); return(ad); }