Beispiel #1
0
        public static void DownloadAndInstallVRCSDK()
        {
            string url = "https://vrchat.net/download/sdk";

            if (File.Exists(PATH.TEMP_VRC_SDK_PACKAGE))
            {
                File.Delete(PATH.TEMP_VRC_SDK_PACKAGE);
            }
            Helper.DownloadFileASync(url, PATH.TEMP_VRC_SDK_PACKAGE, VRCSDKUpdateCallback);
        }
Beispiel #2
0
 private static void InstallModule(string url, string name)
 {
     EditorUtility.DisplayProgressBar(name + " download progress", "", 0);
     Helper.DownloadStringASync(url, delegate(string s)
     {
         if (s.StartsWith("404"))
         {
             Debug.LogWarning(s);
             return;
         }
         //Debug.Log(s);
         ModuleInfo module_info   = Parser.ParseToObject <ModuleInfo>(s);
         string thry_modules_path = ThryEditor.GetThryEditorDirectoryPath();
         string temp_path         = "temp_" + name;
         if (thry_modules_path == null)
         {
             thry_modules_path = "Assets";
         }
         thry_modules_path  += "/thry_modules";
         string install_path = thry_modules_path + "/" + name;
         string base_url     = url.RemoveFileName();
         Helper.WriteStringToFile(s, temp_path + "/module.json");
         int i = 0;
         foreach (string f in module_info.files)
         {
             //Debug.Log(base_url + f);
             Helper.DownloadFileASync(base_url + f, temp_path + "/" + f, delegate(string data)
             {
                 i++;
                 EditorUtility.DisplayProgressBar("Downloading files for " + name, "Downloaded " + base_url + f, (float)i / module_info.files.Count);
                 if (i == module_info.files.Count)
                 {
                     EditorUtility.ClearProgressBar();
                     if (!Directory.Exists(thry_modules_path))
                     {
                         Directory.CreateDirectory(thry_modules_path);
                     }
                     Directory.Move(temp_path, install_path);
                     AssetDatabase.Refresh();
                 }
             });
         }
     });
 }