public void DoUpdate() { if (State == MultiState.Puase || State == MultiState.Done) return; if (IsWaitLoad && mWwwList.Count > 0) return; int count = -1; while (++count < parallelCount && (count + index) < mResList.Count) { #if USE_5_BUNDLE string url = AppSetting.ResourceUrl + "/" + mResList[index + count]; #else string url = AppSetting.ResourceUrl + "/" + mResList[index + count] + ".assetbundle"; #endif WaitForWww www = new WaitForWww {OnCompleted = OnCompleted}; mWwwList.Add(www); www.Start(url); } index += count; // finish if (mWwwList.Count == 0) { State = MultiState.Done; if (OnAllCompleted != null) OnAllCompleted(this); Reset(); } }
public Coroutine Start(string url) { mWww = new WaitForWww(); return mWww.Start(url); }