public string GetABPath_With_Space(LoaderSpace rLoaderSpace, string rABName)
        {
            switch (rLoaderSpace)
            {
            case LoaderSpace.Streaming:
                return(ABPlatform.Instance.GetStreamingFile_CurPlatform(rABName));

            case LoaderSpace.Persistent:
                return(ABPlatform.Instance.GetPersistentFile_CurPlatform(rABName));
            }
            return(ABPlatform.Instance.GetStreamingFile_CurPlatform(rABName));
        }
Exemple #2
0
        public string GetVersionFileUrl(LoaderSpace loaderspace)
        {
            switch (loaderspace)
            {
            case LoaderSpace.Streaming:
                return(Path.Combine(Utility.GetStreamingAssetPath(true), assetBundleVersionFileName));

            case LoaderSpace.Persistent:
                return(Path.Combine(Utility.GetPlatformPrefix(Application.platform), Application.persistentDataPath, assetBundleVersionFileName));

            default:
                return(Path.Combine(AssetBundleManager.BaseDownloadingURL, assetBundleVersionFileName));
            }
        }
        public void AddEntry(LoaderSpace rLoaderSpace, ABVersionEntry rAVEntry)
        {
            ABLoadEntry rABLoadInfo = new ABLoadEntry();

            rABLoadInfo.ABPath = GetABPath_With_Space(rLoaderSpace, rAVEntry.Name);
            rABLoadInfo.ABName = rAVEntry.Name;
            List <string> rDependABs = new List <string>(rAVEntry.Dependencies);

            rABLoadInfo.ABDependNames   = rDependABs.ToArray();
            rABLoadInfo.IsLoading       = false;
            rABLoadInfo.IsLoadCompleted = false;
            rABLoadInfo.CacheAsset      = null;
            rABLoadInfo.RefCount        = 0;

            this.Entries.Add(rAVEntry.Name, rABLoadInfo);
        }
Exemple #4
0
        Dictionary <string, AssetBundleVersion> GetAssetBundleVersion(string text, LoaderSpace loaderSpace)
        {
            Dictionary <string, AssetBundleVersion> assetBundleVersion = new Dictionary <string, AssetBundleVersion>();

            string[] lines = text.Split('\n');
            foreach (string line in lines)
            {
                if (!string.IsNullOrEmpty(line))
                {
                    string[]           info    = line.Split(',');
                    AssetBundleVersion version = new AssetBundleVersion();
                    version.name        = info[0];
                    version.hash        = info[1];
                    version.size        = long.Parse(info[2]);
                    version.loaderSpace = loaderSpace;
                    assetBundleVersion.Add(version.name, version);
                }
            }
            return(assetBundleVersion);
        }