- Home /
Load Unity Scenes from external applications
I want to load different Unity Scenes from a external app (that would act as a launcher) tham im going to write in C#.
Is it possible to make a script that tells unity to load a scene?
Thank You very Much
Application.LoadLevel ("HighScore"); ? http://docs.unity3d.com/Documentation/ScriptReference/Application.LoadLevel.html
@Le_Vailus, thats in game script, I can't just write it in the external app because it won't work, but thanks for replying anyway ;)
Answer by LemonLake · Aug 24, 2013 at 11:52 AM
I would suggest writing this in Java instead, as Java is much like C# however it is cross platform without need for a wrapper such as Mono or Wine.
As for the scene reading, I suggest you have a look at this: http://answers.unity3d.com/questions/138715/read-command-line-arguments.html
Then you would launch your game file with added launch parameters. So to clear things up: You would create a script in your game that reads the parameters passed in your build file. That script would then use Application.LoadLevel to load the scene. Finally your launcher will launch the game with those parameters and a scene number in the build parameters.
Hey, thank you very much ;) I don't have any idea on how to launch the game with the added parameters.
Thank you anyway ;)
If you write it in Java (not JavaScript!), like I suggested, here's how: Process process = new ProcessBuilder("C:\\PathToExe\\$$anonymous$$yExe.exe","param1","param2").start();
Your answer
Follow this Question
Related Questions
Loading a font via WWW 0 Answers
Is there a external script language compatible with every platforms in unity? 0 Answers
Saving informations from game 3 Answers
Upload files to a database 2 Answers