コード例 #1
0
ファイル: BundleLoader.cs プロジェクト: Klanly/u3dgame
        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);
        }
コード例 #2
0
ファイル: PrefabLoader.cs プロジェクト: Klanly/u3dgame
        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);
            }
        }
コード例 #3
0
ファイル: SceneLoader.cs プロジェクト: Klanly/u3dgame
        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);
            }
        }
コード例 #4
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;
                }
            }

            {
                this.LoadLocalPrefab(load_item);
            }
        }
コード例 #5
0
 public void LoadAsset(LoadItem load_item)
 {
     this.AsyncLoadScene(load_item as SceneLoadItem);
 }