Esempio n. 1
0
        public void SetPrereqs(BundlePrecacheManager bundlePrecacheManager, ScenePrereqContentBundlesManifest scenePrereqBundlesManifest)
        {
            if (bundlePrecacheManager == null)
            {
                throw new ArgumentNullException("bundlePrecacheManager");
            }
            this.bundlePrecacheManager = bundlePrecacheManager;
            if (scenePrereqBundlesManifest == null)
            {
                return;
            }
            ContentManifest manifest = bundlePrecacheManager.GetManifest();

            if (manifest == null)
            {
                throw new ContentManifestException("No Contentmanifest set in BundlePreCacheManager to reference for scene prerequisites.");
            }
            foreach (KeyValuePair <string, string[]> item in scenePrereqBundlesManifest)
            {
                string   key   = item.Key;
                string[] value = item.Value;
                if (value == null)
                {
                    continue;
                }
                List <ContentManifest.BundleEntry> list = new List <ContentManifest.BundleEntry>();
                string[] array = value;
                foreach (string text in array)
                {
                    if (!manifest.BundleEntryMap.ContainsKey(text))
                    {
                        throw new ContentManifestException("Expected bundle key not found in BundleEntryMap for bundleKey=" + text);
                    }
                    list.Add(manifest.BundleEntryMap[text]);
                }
                if (list.Count > 0)
                {
                    scenePrereqBundles.Add(item.Key, list.ToArray());
                }
            }
        }
Esempio n. 2
0
 public ScenePrereqContentManager(BundlePrecacheManager bundlePrecacheManager, ScenePrereqContentBundlesManifest prereqs)
 {
     scenePrereqBundles = new Dictionary <string, ContentManifest.BundleEntry[]>();
     SetPrereqs(bundlePrecacheManager, prereqs);
 }