Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Tested only on Windows
- // Assumes builds are in the project folder (e.g. your-game/Builds/Build.exe)
- using System;
- using System.IO;
- using System.Diagnostics;
- public static class BuildRunning
- {
- public bool IsBuildRunning()
- {
- string projectDirectory = Directory.GetParent(Application.dataPath).Name;
- foreach (Process p in Process.GetProcesses())
- {
- string fileName = Path.GetFullPath(p.MainModule.FileName);
- if (fileName.Contains(projectDirectory))
- {
- return true;
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement