Exemple #1
0
        public void LoadAsset(LoadItem load_item)
        {
            if (null == manifest)
            {
                manifest = LoadAssetBundleManifest();
            }

            LoadItem same_load_item;

            if (loadDic.TryGetValue(load_item.asset_id, out same_load_item))
            {
                same_load_item.load_callback += load_item.load_callback;
                return;
            }

            this.LoadDependencies(load_item);
            this.loadQueue.Enqueue(load_item);
        }
Exemple #2
0
        private void Update()
        {
            if (this.loadQueue.Count <= 0)
            {
                return;
            }

            LoadItem load_item  = this.loadQueue.Dequeue();
            string   asset_name = load_item.asset_id.assetName;

            {
                AssetItem asset_item = CacheManager.Instance.GetAssetItem(load_item.asset_id, AssetType.PREFAB);
                if (null != asset_item)
                {
                    this.loadDic.Remove(asset_item.assetId);
                    load_item.load_callback(asset_item);
                    return;
                }
            }

            {
                AssetItem asset_item = CacheManager.Instance.GetAssetItem(load_item.asset_id, AssetType.BUNDLE);
                if (null != asset_item)
                {
                    Scheduler.RunCoroutine(
                        this.LoadPrefabFromBundle(asset_item, asset_name, load_item.load_callback));
                    return;
                }
            }

            {
                LoadItem load_bundle_item = new LoadItem();
                load_bundle_item.asset_id      = load_item.asset_id;
                load_bundle_item.type          = AssetType.BUNDLE;
                load_bundle_item.load_callback = (AssetItem asset_item) =>
                {
                    Scheduler.RunCoroutine(
                        this.LoadPrefabFromBundle(asset_item, asset_name, load_item.load_callback));
                };
                LoaderManager.Instance.LoadAsset(load_bundle_item);
            }
        }
Exemple #3
0
        public void LoadAsset(LoadItem load_item)
        {
            {
                if (CacheManager.Instance.IsExistAsset(load_item.asset_id, AssetType.BUNDLE))
                {
                    this.AsyncLoadScene(load_item as SceneLoadItem);
                    return;
                }
            }

            {
                LoadItem load_bundle_item = new LoadItem();
                load_bundle_item.asset_id      = load_item.asset_id;
                load_bundle_item.type          = AssetType.BUNDLE;
                load_bundle_item.load_callback = (AssetItem asset_item) =>
                {
                    this.AsyncLoadScene(load_item as SceneLoadItem);
                };
                LoaderManager.Instance.LoadAsset(load_bundle_item);
            }
        }
        private void Update()
        {
            if (this.loadQueue.Count <= 0)
            {
                return;
            }

            LoadItem load_item  = this.loadQueue.Dequeue();
            string   asset_name = load_item.asset_id.assetName;

            {
                AssetItem asset_item = CacheManager.Instance.GetAssetItem(load_item.asset_id, AssetType.PREFAB);
                if (null != asset_item)
                {
                    this.loadDic.Remove(asset_item.assetId);
                    load_item.load_callback(asset_item);
                    return;
                }
            }

            {
                this.LoadLocalPrefab(load_item);
            }
        }
Exemple #5
0
 public void LoadAsset(LoadItem load_item)
 {
     this.AsyncLoadScene(load_item as SceneLoadItem);
 }