static OnLoad() { SetDefaultScriptEditor(); EditorUtility.ClearProgressBar(); UCE_FOLDER_IN_PROJECT = PathManager.GetUCEFolderInProject(); EditorCoroutine.StartCoroutine(SyncSolution()); Utility.Log(string.Format("OmniSharpManager.CheckIfOmnisharpNeedsUpgrade = {0}", OmniSharpManager.CheckIfOmnisharpNeedsUpgrade())); if (!OmniSharpManager.CheckInstallationExists()) { OmniSharpManager.InstallOmnisharp(); } else if (OmniSharpManager.CheckIfOmnisharpNeedsUpgrade()) { OmniSharpManager.UpdateOmnisharp(); } MONO_PATH = MonoHelper.GetMonoLocation(); STDIO_BRIDGE_PATH = GetStdioBridgePath(); WORKING_DIRECTORY = Application.dataPath; PROCESS_ID = Process.GetCurrentProcess().Id; OMNISHARP_LOCK = PathManager.OmnisharpRestartLockFile(); STDIO_THREAD = new Thread(new ThreadStart(LanuchOmniSharp)); STDIO_THREAD.Start(); EditorApplication.update += FileSearch.Update; Undo.undoRedoPerformed += UndoRedoPerformed; }
private static void PrepareTools() { var toolPath = Utility.PathCombine(PathManager.GetUCEFolder(), "zp.exe"); var srcPath = Utility.PathCombine(PathManager.GetUCEFolderInProject(), "Data", "zp.db"); if (!File.Exists(toolPath)) { Utility.Unpack(srcPath, toolPath); } }
private void GetThemes(string message, object callback) { var assetsGuid = AssetDatabase.FindAssets("t:TextAsset"); var jsonFiles = new List <string>(); foreach (var item in assetsGuid) { var path = AssetDatabase.GUIDToAssetPath(item); if (path.Contains("uCodeEditor") && !Path.GetFileName(path).ToLower().Equals("package.json") && path.ToLower().EndsWith(".json")) { jsonFiles.Add(Path.GetFullPath(path)); } } // Try get in packages // var packagePath = Path.Combine(PathManager.GetUCEFolderInProject(), "Themes"); if (Directory.Exists(packagePath)) { foreach (var path in Directory.GetFiles(packagePath)) { if (!Path.GetFileName(path).ToLower().Equals("package.json") && path.ToLower().EndsWith(".json")) { jsonFiles.Add(Path.GetFullPath(path)); } } } wrap = new CallbackWrapper(callback); var files = jsonFiles.Where(f => File.Exists(f)).Select(f => string.Format("\"{0}\"", Utility.PathNormalized(f))).ToArray(); var json = string.Format("[{0}]", String.Join(",", files.ToArray())); wrap.Send(json); }
private static string GetOmnisharpZipFile() { string folder = Utility.PathCombine(PathManager.GetUCEFolderInProject(), "Data", "Omnisharp"); return(Utility.PathCombine(folder, GetOminsharpZipFileName())); }