예제 #1
0
        protected virtual Resource CreateResource(string name, LoadPriority priority)
        {
            Resource res = new Resource();

            res.Name            = name;
            res.Loader.Priority = priority;
            mDownResource.Add(res);

            BundleIndexItemInfo bundleInfo = ResourceMgr.GetBundleInfo(name);

            if (bundleInfo != null)
            {
                res.Size = bundleInfo.BundleSize;
            }

            res.AddGotWWWCallback(this.OnLoadWWW);

            return(res);
        }
예제 #2
0
        internal void EnsureDependencies(string name)
        {
            RuntimeBundleInfo assetBelongBundleInfo = ResourceMgr.GetBundleInfo(name);

            if (assetBelongBundleInfo == null)
            {
                Debug.LogError($"can't find asset {name} belong bundle");
                return;
            }

            for (int i = 0; i < assetBelongBundleInfo.BundleDependencyArray.Length; ++i)
            {
                string dependencyBundleName = assetBelongBundleInfo.BundleDependencyArray[i];
                if (!HasLoaded(dependencyBundleName))
                {
                    ResourceModule.Instance.PreloadBundle(dependencyBundleName, null);
                }
            }
        }
예제 #3
0
        public void SetAssetBundlePersistent(string bundleName)
        {
            var bundle = resourceMgr.GetBundleInfo(bundleName);

            bundle.BundlePersistent = true;
        }