Added convenience functions for command line argument setting to OpenSeeLauncher.

This commit is contained in:
Emiliana 2020-08-21 22:07:12 +02:00
parent 905b1780fa
commit 42245749b3

View file

@ -79,6 +79,30 @@ public class OpenSeeLauncher : MonoBehaviour {
private System.IntPtr processStdOut = System.IntPtr.Zero;
private System.IntPtr processStdErr = System.IntPtr.Zero;
private Job job = null;
public void UnsetOption(string name, bool hasArgument) {
int count = 1;
if (hasArgument)
count++;
int found = -1;
int i = 0;
foreach (string arg in commandlineOptions) {
if (arg == name) {
found = i;
break;
}
i++;
}
if (found > -1)
commandlineOptions.RemoveRange(found, count);
}
public void SetOption(string name, string argument) {
UnsetOption(name, argument != null);
commandlineOptions.Add(name);
if (argument != null)
commandlineOptions.Add(name);
}
private bool CheckSetup(bool requireTarget) {
if (openSeeTarget == null)