When making my first networked game in Unity, I found a way to keep two copies of the same project open at once. Unity will usually only open the same project one time. In a networked application, this means that you either have to build the client or server application, then run as the other side within Unity. Not only is this a hassle, but you can only debug one side of the program at a time.
Being able to have the same project open with two Unity windows allowed me to develop much faster.
The key to having the project open twice is to have two project directories that point to the same source files. A Unity project has three sub-directories: Assets, Library and ProjectSettings. Everything the developer creates goes in Assets and Unity controls the other two directories. So, to have two Unity windows into the same project, you have to create two project directories that share the same Assets directory.
I did this in Windows 10 with Unity 5.3. I’d expect this to work for Windows 7+ and Unity 5.x.
- Create your project in Unity. Get everything setup the way you want it. Exit Unity.
- Copy the whole project directory: Use the GUI -OR- xcopy /e/h Game GameCopy
- Delete the Assets sub-dir In the new project directory: Use the GUI -OR- del /s GameCopy/Assets
- Link the original Asset directory to the new directory: (in an elevated command prompt) mklink /j GameCopy/Assets Game/Assets
Now you can bring up one Unit window on the Game project and another on the GameCopy project. Any asset changes (code, scenes, graphics, audio, prefab, etc) that you make in one Unity window will show up in the other Unity. The only thing that isn’t shared are project settings.
Remember that you don’t actually have two copies of your assets. Any changes/additions/deletions in one directory are done to both!
In Linux/Mac, I’d try a soft link first and see if that works. If that fails, make a hard link.
One thought on “How To: Open the same Unity project twice”