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?
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.
You can open multiple instances of the Project window using the Add Tab menu item in the EditorWindow context menu.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With