public void LoadAsync(string name, System.Type type, LoadedCallBack cb) { if (dicAsset.ContainsKey(name)) { cb(dicAsset[name]); } else { listCB.Add(new CallBackNode(name, cb)); LoadAsync(name, type); } }
/// <summary> /// Load Asset check path local first and remote then /// </summary> public void LoadTexture(string _path, LoadedCallBack _loadedCB) { string path = "Texture/" + _path; if (mTextureTable.ContainsKey(path)) { _loadedCB(mTextureTable[path]); return; } Texture2D texture = Resources.Load(path, typeof(Texture2D)) as Texture2D; if (texture != null) { mTextureTable[path] = texture; _loadedCB(texture); return; } Downloader.Instance.LoadAsyncTexture(path, _loadedCB); }
public void LoadAsyncTextasset(string name, LoadedCallBack cb) { LoadAsync(name, typeof(TextAsset), cb); }
public void LoadAsyncTexture(string name, LoadedCallBack cb) { LoadAsync(name, typeof(Texture), cb); }
public CallBackNode(string _name, LoadedCallBack _cb) { name = _name; cb = _cb; }
public void LoadItemTexture(string _name, LoadedCallBack _loadedCB) { string directory = "Item/"; LoadTexture(directory + _name, _loadedCB); }