private static void LoadModules()
 {
     modules_are_being_loaded = true;
     WebHelper.DownloadStringASync(URL.PUBLIC_MODULES_COLLECTION, delegate(string s) {
         modules = new List <ModuleHeader>();
         List <string> module_urls = Parser.ParseToObject <List <string> >(s);
         foreach (string url in module_urls)
         {
             WebHelper.DownloadStringASync(url, delegate(string data)
             {
                 ModuleHeader new_module     = new ModuleHeader();
                 new_module.url              = url;
                 new_module.available_module = Parser.ParseToObject <ModuleInfo>(data);
                 InitInstalledModule(new_module);
                 if (new_module.available_module.requirement != null)
                 {
                     new_module.available_requirement_fullfilled = new_module.available_module.requirement.Test();
                 }
                 modules.Add(new_module);
                 //Debug.Log(Parser.ObjectToString(new_module));
                 UnityHelper.RepaintEditorWindow(typeof(Settings));
             });
         }
     });
 }
Exemplo n.º 2
0
 private static void LoadModule(ModuleCollectionInfo info, List <Module> modules)
 {
     WebHelper.DownloadStringASync(info.url, delegate(string data)
     {
         Module new_module                   = new Module();
         new_module.url                      = info.url;
         new_module.author                   = info.author;
         new_module.id                       = info.id;
         new_module.available_module         = Parser.ParseToObject <ModuleInfo>(data);
         new_module.available_module.version = new_module.available_module.version.Replace(",", ".");
         bool module_installed               = LoadModuleLocationData(new_module);
         if (module_installed)
         {
             InitInstalledModule(new_module);
         }
         else if (Helper.ClassWithNamespaceExists(new_module.available_module.classname))
         {
             CheckForUnregisteredInstall(new_module);
         }
         if (new_module.installed_module != null)
         {
             new_module.installed_module.version = new_module.installed_module.version.Replace(",", ".");
         }
         if (new_module.available_module.requirement != null)
         {
             new_module.available_requirement_fullfilled = new_module.available_module.requirement.Test();
         }
         if (new_module.available_requirement_fullfilled && new_module.installed_module != null && Helper.CompareVersions(new_module.installed_module.version, new_module.available_module.version) == 1)
         {
             new_module.update_available = true;
         }
         modules.Add(new_module);
         UnityHelper.RepaintEditorWindow <Settings>();
     });
 }