- Home /
get a variable externally
I would like to save log file using user-defined filename when the game starts.
I can use the following VBScript code to get the filename, and start the game, but I have no idea how to pass the variable(usrName) to Unity, and how can Unity read the variable?
Or is there any other way to get the variable for Unity?
Dim usrName usrName = Inputbox("Enter fileName","Enter file") Set WShell = CreateObject("WScript.Shell") WShell.Run "C:\unity\test_unity.exe"
Answer by DaveA · Aug 19, 2011 at 08:40 PM
You mean like command line params? http://unity3d.com/support/documentation/Manual/Command%20Line%20Arguments.html
I'm not sure it's possible like that. I use the registry to poke values into the PlayerPrefs then in Unity scripts, read them from PlayerPrefs
Sorry, I mean passing variable when starting built game, not Unity itself.
Would you explain a bit more how exactly send the values into the PlayerPrefs then in Unity scripts?
Your answer
Follow this Question
Related Questions
Converting JS to C# Issue 2 Answers
GameObject.Find either can't be called or is in the wrong scope. 0 Answers
Where did my 'j' go? 0 Answers
how to make public float refer to another script 0 Answers
relate two variables 1 Answer