Ejemplo n.º 1
0
        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);
            });
        }
Ejemplo n.º 2
0
        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);
            });
        }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
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);
            });
        }
Ejemplo n.º 5
0
        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);
            });
        }
Ejemplo n.º 6
0
        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);
            }
        }
Ejemplo n.º 7
0
 public void LoadAsset(string url, AssetConfig config, Action <string> callback)
 {
     this._assetConfigDict[url] = config;
     base.LoadAsset(url, callback, 0);
 }