Esempio n. 1
0
 private void ProcessPendingPatches()
 {
     if (this.pendingPatches.Count > 0 && this.pendingPatchesData.ContainsKey(this.pendingPatches[0]))
     {
         string  text = this.pendingPatches[0];
         JoeFile key  = this.pendingPatchesData[text].Key;
         Catalog.CatalogDelegate value = this.pendingPatchesData[text].Value;
         this.ProcessPendingPatch(text, key, value);
     }
 }
Esempio n. 2
0
        private void ProcessJoe(JoeFile joe, object cookie)
        {
            KeyValuePair <string, Catalog.CatalogDelegate> keyValuePair = (KeyValuePair <string, Catalog.CatalogDelegate>)cookie;
            string key = keyValuePair.Key;

            Catalog.CatalogDelegate value = keyValuePair.Value;
            Service.AssetManager.Unload(this.assetHandles[key]);
            this.assetHandles.Remove(key);
            this.ProcessPendingPatch(key, joe, value);
        }
Esempio n. 3
0
        public void PatchData(string catalogFile, Catalog.CatalogDelegate completeCallback)
        {
            catalogFile = catalogFile.Replace(".json", ".json.joe");
            int          num          = catalogFile.LastIndexOf("/");
            string       assetName    = catalogFile.Substring(num + 1);
            string       assetPath    = catalogFile.Substring(0, num);
            AssetManager assetManager = Service.Get <AssetManager>();

            assetManager.AddJoeFileToManifest(assetName, assetPath);
            assetManager.RegisterPreloadableAsset(assetName);
            object      cookie = new KeyValuePair <string, Catalog.CatalogDelegate>(catalogFile, completeCallback);
            AssetHandle value  = AssetHandle.Invalid;

            assetManager.Load(ref value, assetName, new AssetSuccessDelegate(this.AssetSuccess), new AssetFailureDelegate(this.AssetFailure), cookie);
            this.assetHandles.Add(catalogFile, value);
        }
Esempio n. 4
0
        private void ProcessJoe(JoeFile joe, object cookie)
        {
            KeyValuePair <string, Catalog.CatalogDelegate> keyValuePair = (KeyValuePair <string, Catalog.CatalogDelegate>)cookie;
            string text = keyValuePair.get_Key();

            Catalog.CatalogDelegate value = keyValuePair.get_Value();
            Service.Get <AssetManager>().Unload(this.assetHandles[text]);
            this.assetHandles.Remove(text);
            if (joe != null)
            {
                this.ParseCatalog(joe);
            }
            if (value != null)
            {
                text = text.Replace(".json.joe", ".json");
                value(joe != null, text);
            }
        }
Esempio n. 5
0
 private void ProcessPendingPatch(string catalogFile, JoeFile joe, Catalog.CatalogDelegate completeCallback)
 {
     if (joe != null)
     {
         if (this.pendingPatches.Count > 0 && this.pendingPatches[0] != catalogFile)
         {
             this.pendingPatchesData[catalogFile] = new KeyValuePair <JoeFile, Catalog.CatalogDelegate>(joe, completeCallback);
             return;
         }
         this.ParseCatalog(joe);
     }
     this.pendingPatches.Remove(catalogFile);
     this.pendingPatchesData.Remove(catalogFile);
     if (completeCallback != null)
     {
         catalogFile = catalogFile.Replace(".json.joe", ".json");
         completeCallback(joe != null, catalogFile);
     }
     this.ProcessPendingPatches();
 }