public static void OnEditorRemove()
        {
            string dir_path = ThryEditor.GetThryEditorDirectoryPath() + "/thry_modules";

            if (Directory.Exists(dir_path))
            {
                TrashHandler.MoveDirectoryToTrash(dir_path);
            }
        }
Пример #2
0
        private static string GetThryModulesDirectoryPath()
        {
            string editor_path = ThryEditor.GetThryEditorDirectoryPath();

            if (editor_path == null)
            {
                editor_path = "Assets";
            }
            return(editor_path + "/thry_modules");
        }
Пример #3
0
        private static bool CheckForEditorRemove(string[] assets)
        {
            string test_for = ThryEditor.GetThryEditorDirectoryPath() + "/Editor/ThryEditor.cs";

            foreach (string p in assets)
            {
                if (p == test_for)
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #4
0
        static OnCompileHandler()
        {
            //Init Editor Variables with paths
            ThryEditor.GetThryEditorDirectoryPath();

            VRCInterface.OnCompile();
            Config.OnCompile();
            ModuleHandler.OnCompile();
            TrashHandler.EmptyThryTrash();

            UnityFixer.CheckAPICompatibility(); //check that Net_2.0 is ApiLevel
            UnityFixer.CheckDrawingDll();       //check that drawing.dll is imported
        }
 private static void InstallModule(string url, string name)
 {
     EditorUtility.DisplayProgressBar(name + " download progress", "", 0);
     WebHelper.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();
         FileHelper.WriteStringToFile(s, temp_path + "/module.json");
         int i = 0;
         foreach (string f in module_info.files)
         {
             //Debug.Log(base_url + f);
             WebHelper.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();
                 }
             });
         }
     });
 }