- Home /
Prevent multiple launches of Unity Application
I was wondering if it's possible in unity to stop the application from being run with multiple instances by the user.
Answer by Justin Warner · Apr 19, 2011 at 09:41 PM
It shouldn't let you.
Unity auto-opens (Unless that's just me, but I checked the prefs and it doesn't allow me to change anything) the latest project, and therefor doesn't work as I can't have the same project opened twice...
But yeah, maybe explain/take screen shot? I don't know =/
Oh sorry I meant as in a game that I created in unity. I would like to stop that from being launched twice in a row.
Eh... $$anonymous$$aybe someone'll answer, but I think it'd be a little rude if a user wants to play multiple games as they can't play yours and someone elses, However, a small rough thing you could do: Have it in the player prefs, On away, change a "In game" value to true (1), then if they player pushes the EXIT GUI, change that to 0, and then check on awake of your app whether it's 1 or 0, if it's 1, exit instantly, if 0, then keep on going... http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html
Oh I don't $$anonymous$$d that at all, I just don't want them having two copies of my game running. Thanks, I'll give this a try
Alright, this can work, but it'll take a lot of tweaking. Good luck!
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Spells - storage, etc... [c#] 2 Answers
Procedurally Generated Room System... 1 Answer
2D in Unity3D 2 Answers
Support for System.Management in Unity, getting TypeLoader Exception 1 Answer