29 public override bool OpenApplication(
string applicationPath,
string[] argumentKeys,
string[] argumentValues)
31 UDebug.Log($
"{GetType().Name}::OpenApplication");
32 if (!
string.IsNullOrEmpty(applicationPath))
34 UDebug.Log(
"Application is empty.");
38 if (!File.Exists(applicationPath))
40 UDebug.Log($
"Application does not exist at {applicationPath}");
44 int argumentCount = Mathf.Max(argumentKeys.Length, argumentValues.Length);
45 if(argumentKeys.Length != argumentValues.Length)
47 UDebug.LogWarning(
"The number of argument keys and values are not equal. Extra arguments will not be provided and mapping could be messed up.");
50 string arguments =
"";
51 for(
int argumentIndex = 0; argumentIndex < argumentCount; argumentIndex++)
58 arguments += $
"-{argumentKeys[argumentIndex]} \"{argumentValues[argumentIndex]}\"";
61 using (Process process =
new Process())
63 process.StartInfo.WorkingDirectory = applicationPath;
64 process.StartInfo.Arguments = arguments;
65 process.StartInfo.FileName = applicationPath;
76 return new Dictionary<string, string>();
78 string[] args = System.Environment.GetCommandLineArgs();
80 UDebug.Log($
"First argument: {args[0]}");
82 if(!
string.IsNullOrEmpty(Application.absoluteURL))
84 string urlData = Application.absoluteURL;
85 UDebug.Log($
"[PixoIOSPlatformUtilities] Parse from URL {urlData}");
89 UDebug.Log(
"[PixoIOSPlatformUtilities] Parsing arguments from commandline.");
92 Dictionary<string, string> parameters =
new Dictionary<string, string>();
95 for(
int argumentIndex = 1; argumentIndex < args.Length; argumentIndex++)
97 if (args[argumentIndex].StartsWith(
'-') && ((argumentIndex + 1) < args.Length))
99 parameters.Add(args[argumentIndex].Remove(0), args[argumentIndex + 1]);