static void HookWatchers() { EditorApplication.update += OnEditorApplicationUpdate; m_Watcher.matchedMethods.Add("OnChanged", () => { Debug.Log("Origin files has been changed!"); }); m_Watcher.StartFSW(); }
private static void HookWatchers() //I have to fix this because it deletes on reload in some editors... { //Detect new file and add them to the solution? (I have to) EditorApplication.update += OnEditorApplicationUpdate; if (!availablePaths) { Debug.LogError("There are one or more paths unsetted, go to Lerp2Dev Team Tools > Refresh Project API Dependencies... to set the paths of the Project in your HDD and the path of this project."); return; } string bPath = LerpedCore.GetString(buildPath); m_Watcher = new LerpedThread <FileSystemWatcher>(t_CompileWatcher, new FSWParams(Path.Combine(Path.GetDirectoryName(bPath), "Project"), "*.cs", NotifyFilters.LastWrite | NotifyFilters.Size, true)); m_Watcher.matchedMethods.Add(WatcherChangeTypes.Changed.ToString(), () => { LerpedPaths lp = EditorWindow.GetWindow <LerpedPaths>(); lp.iInit(lp, LerpedAPIChange.Auto); }); //m_Watcher.Created += new FileSystemEventHandler(); //I have to add files to the raw solution before compile //m_Watcher.Renamed += new FileSystemEventHandler(); //I have to rename files to the raw solution before compile //m_Watcher.Deleted += new FileSystemEventHandler(); //I have to remove files to the raw solution before compile m_Watcher.StartFSW(); }