- Home /
Having an exe run in bg, unity still responsive
I have an exe that is started by unity, that when it starts sends input to unity that i can use.
I have a problem, that when those exe's start up , it "freases" unity and you are not able to continue playing your game.
How do i send those console windows to the background and stop it affecting unity at all?
Images attached to what i mean, and my code snipped added below (the minimize part in my code didnt work by the way.. dont know if im doing it wrong..)
 Process p;
     // Use this for initialization
     void Start () {
         
         ProcessStartInfo info = new ProcessStartInfo();
         
         //Process.Start(@"Directory");
         
         info.FileName = @"Directory";
         info.WorkingDirectory = @"Directoryalt text";
         info.Arguments = "";
         info.UseShellExecute = false;
         info.RedirectStandardOutput = true;
         //info.WindowStyle = ProcessWindowStyle.Minimized;
         info.WindowStyle = ProcessWindowStyle.Hidden;
         
         p = Process.Start(info);
         
         if ( p != null )
         print(p.StandardOutput.ReadToEnd());
     }

Have you set Unity to run in background?
You can do that either by dropping Application.runInBackground somewhere in your code or by going to Edit->Project Settings->Player->Resolution and Presentation and then checking the box near `Run In Background*`
Ive tried running it with that checked, and without it, still the same...
Answer by RNOVAKOSKY · Aug 07, 2013 at 01:50 AM
You can start your process inside one thread. See System.Threading
Your answer
 
 
             Follow this Question
Related Questions
A node in a childnode? 1 Answer
Unity 3D download as ZIP 0 Answers
How to hide Unity files 1 Answer
Works when testing in unity but not as a built project 0 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                