private WWWHelper CreateDownLoader(DownLoadResType resType) { GameObject go = new GameObject(); go.name = "ResDownLoader"; WWWHelper loader = null; switch (resType) { case DownLoadResType.Null: loader = go.AddComponent <WWWHelper>(); break; case DownLoadResType.Image: loader = go.AddComponent <ResImageDownLoader>(); break; default: break; } return(loader); }
public void DestroyDownLoader(WWWHelper loader) { ResDownLoaderList.Remove(loader); loader.Destroy(); }
public void DownLoad(string url, DownLoadResType resType, Action <DownLoadResDesc> callBack) { WWWHelper loader = CreateDownLoader(resType); loader.DownLoad(url, callBack); }