|
Hello, I need to start my standalone application with given parameters. Something like : applicationName -s 1 -e 100 -b 2 Is there any way of doing this ?
(comments are locked)
|
|
You should be able to use: string[] System.Environment.GetCommandLineArgs() http://msdn.microsoft.com/en-us/library/system.environment.getcommandlineargs.aspx
(comments are locked)
|
|
Unity's API currently doesn't expose this information for use in scripting (although there are some pre-set command line options which Unity builds respond to). The only method I've seen suggested (on this forum post) to achieve what you want is to use a C++ plugin, which uses:
which would get the entire command line as a string, and then you'd have to parse the string yourself. I haven't tried this though, so I don't even know whether it actually works. I also had a quick look on the Unity UserVoice feature request site, to see whether this has already been requested, but I couldn't see any evidence of it. There are a few requests which mention the term "command line", but none seem to be what you want - which I find surprising, since it seems a very useful feature. Perhaps you could start a new feature request, and post a link to your new request here and to any of the old forum threads which mention this issue too? This can already be done from C# using string[] System.Environment.GetCommandLineArgs()
Mar 30 '10 at 05:40 PM
Joachim Ante
Oh, nice. - Please mark Joachim's answer as "accepted", not mine!
Mar 30 '10 at 05:55 PM
duck ♦♦
(comments are locked)
|
|
If you're on OSX, then you can use this as a workaround:
(comments are locked)
|
