protected virtual Resource CreateResource(string name, LoadPriority priority)
        {
            Resource res = new Resource();

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

            GOEBundle bundle = ResourceMgr.GetBundle(name);

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

            res.AddGotWWWCallback(this.OnLoadWWW);

            return(res);
        }
        protected override void OnLoadAssetBundle(string name, AssetBundle www, bool dependencyResource)
        {
            if (www == null)
            {
                Logger.GetFile(LogFile.Res).LogError(name + " assetBundel == null");
                return;
            }
            string sceneName = GetSceneName(name);

            cachedBundles.Add(www);
            cachedNames.Add(sceneName);
            GOEBundle bundle = ResourceMgr.GetBundle(name);

            ResourceMgr.CacheSceneBundleDependency(bundle);
            if (sceneName == mCurScene)
            {
                this.LoadScene(sceneName);
            }
        }
Example #3
0
        internal void EnsureDependencies(string name)
        {
            string bundleName = ResourceMgr.GetBundleName(name);

            if (!string.IsNullOrEmpty(bundleName))
            {
                GOEBundle bundle = ResourceMgr.GetBundle(bundleName);
                if (bundle != null)
                {
                    foreach (var dep in bundle.DependsOn)
                    {
                        GOEBundle depBundle = ResourceMgr.GetBundle(dep);
                        if (depBundle == null)
                        {
                            continue;
                        }
                        if (!HasLoaded(depBundle.FirstAsset))
                        {
                            GOERoot.ResMgr.PreloadBundle(dep, null);
                        }
                    }
                }
            }
        }
Example #4
0
        public void SetAssetBundlePersistent(string bundleName)
        {
            var bundle = resourceMgr.GetBundle(bundleName);

            bundle.BundlePersistent = true;
        }