public override void DoUpdate() { int i = Count - 1; while (i >= 0) { LoadStruct ls = loadingAsset[i]; if (ls.infor.isDone()) { loadingAsset.RemoveAt(i); Count--; ls.funOnLoadComplete(ls.infor); } i--; } }
public void Load( string url, LoadComplete funOnLoadComplete, AssetType type ) { AssetInfo infor = AssetLoader.GetInstance().Load(url, type); if (infor.isDone()) { funOnLoadComplete(infor); return; } LoadStruct ls = new LoadStruct(); ls.infor = infor; ls.funOnLoadComplete = funOnLoadComplete; loadingAsset.Insert(0, ls); Count = loadingAsset.Count; }