private static void LoadImage(string url, bool isCacheInMemory, Action <Texture2D> callback) { AssetConfig config = new AssetConfig(AssetType.Image, isCacheInMemory); AssetManager._assetLoader.LoadAsset(url, config, delegate(string pUrl) { AssetManager.OnLoadImage(url, callback); }); }
private static void LoadAssetBundle(string url, Action <AssetBundle> callback) { AssetConfig config = new AssetConfig(AssetType.Assetbundle, false); AssetManager._assetLoader.LoadAsset(url, config, delegate(string pUrl) { AssetManager.OnLoadAssetBundle(url, callback); }); }
public void LoadLuaAssetList(List <string> urlList, Action <List <string> > callback) { for (int i = 0; i < urlList.Count; i++) { AssetConfig value = new AssetConfig(AssetType.Lua, true); this._assetConfigDict[urlList[i]] = value; } base.LoadAssetList(urlList, callback, 0); }
private static void LoadPrefab(string url, bool isCacheInMemory, Action <GameObject> callback) { if (CacheManager.IsAssetExists(url)) { url = CacheManager.GetCachedAssetPath(url); } AssetConfig config = new AssetConfig(AssetType.Prefab, isCacheInMemory); AssetManager._assetLoader.LoadAsset(url, config, delegate(string pUrl) { AssetManager.OnLoadPrefab(pUrl, callback); }); }
private static void LoadProgramPrefab(RemoteConfig.AssetInfo assetInfo, bool isCacheInMemory, Action <GameObject> callback) { string url = assetInfo.url; if (CacheManager.IsProgramAssetExists(assetInfo.name, assetInfo.md5)) { url = CacheManager.GetCachedProgramAssetUrl(assetInfo.url); } AssetConfig config = new AssetConfig(AssetType.Prefab, isCacheInMemory); AssetManager._assetLoader.LoadAsset(url, config, delegate(string pUrl) { AssetManager.OnLoadPrefab(pUrl, callback); }); }
public static bool ParseAsset(string url, AssetConfig config) { switch (config.type) { case AssetType.Lua: return(AssetPool.ParseLuaAsset(url)); case AssetType.Prefab: return(AssetPool.ParsePrefabAsset(url, config.isCacheInMemory)); case AssetType.Image: return(AssetPool.ParseImageAsset(url, config.isCacheInMemory)); case AssetType.Assetbundle: return(AssetPool.ParseAssetBundle(url)); default: return(false); } }
public void LoadAsset(string url, AssetConfig config, Action <string> callback) { this._assetConfigDict[url] = config; base.LoadAsset(url, callback, 0); }