Added convenience functions for command line argument setting to OpenSeeLauncher.
This commit is contained in:
parent
905b1780fa
commit
42245749b3
1 changed files with 24 additions and 0 deletions
|
|
@ -80,6 +80,30 @@ public class OpenSeeLauncher : MonoBehaviour {
|
|||
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)
|
||||
openSeeTarget = GetComponent<OpenSee>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue