I am calling an executable from my Unity project. The executable contains a function which works with timer (predefined time for example 10seconds). What I want is to change the functionality a little bit instead of running with a timer to give as an input to the .exe a boolean flag with which I ll be able to continue the execution of the executable or stop it. However to do so, I have to give a dynamic input to the .exe. Is is possible to do so? And if that is possible how can I do so, without spending much system resources?
EDIT:
void record(){
string[] args = { path, dataDir, Date+"\\", name, surname };
System.Diagnostics.Process.Start(execDir, String.Join(" ", args));
}
OnGUI code:
if (GUI.Button (new Rect (150,250, 100, 50), "RECORD")) {
record();
}
if (GUI.Button (new Rect (270,250, 100, 50), "STOP")) {
stop_recording();
}
This function record calls an executable which wrote several stuff to binary file. I have also a Stop button in which I want to add the flag. When the button pressed the flag will be true and I want to parse that value as argument into the execDir executable.