Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Visual Studio Projects in Unity

Tags:

unity3d

unity5

I am trying to move all of my non Unity-specific code into classes which don't inherit from MonoBehaviour, similar to this. I created a separate Visual Studio project called Models for all of my non-MonoBehaviour classes, and I added that project to the Visual Studio solution. However, I can't add a reference to my Models project to my Unity project through Visual Studio (the Add Reference button isn't there when I click on the Unity project, and I've read that Unity automatically rebuilds its Visual Studio project anyway, so any added references would be lost), so I set the output location of my Models .dll to the Assets folder in Unity and I added that .dll to my Project view in Unity. That's all working. The problem is that whenever I rebuild my Models project, the Unity project in Visual Studio doesn't seem to pick up the changes, so I have to delete the .dll from the Project view in Unity and re-add it every time I make any changes to the Models project.

Is there a way to have Visual Studio automatically see the changes to my Models .dll, or is there a better way to go about having my Unity project reference another Visual Studio project?

like image 867
Ben Rubin Avatar asked Jul 16 '16 15:07

Ben Rubin


People also ask

Can you open multiple projects in Visual Studio?

To open a second instance of the integrated development environment (IDE), right-click on the Visual Studio icon in your dock or Applications folder, and select New Instance.

Can I open 2 Unity projects at once?

You can open multiple instances of the Project window using the Add Tab menu item in the EditorWindow context menu.

Can we open multiple projects in Visual Studio Code?

You can work with multiple project folders in Visual Studio Code with multi-root workspaces. This can be helpful when you are working on several related projects at one time.


1 Answers

I tried researching this for you, and the closest thing i could find so far is this: http://devleader.ca/2015/02/08/multiple-c-projects-unity-3d-solution/

It details how to adopt unity and visual studio to work well and sync up correctly without rebuilding/running/other crazy things to get the projects working together.

Hope it helps.

like image 199
Kathryn Hazuka Avatar answered Sep 27 '22 17:09

Kathryn Hazuka