Hello everyone!
So, I’m currently working on a game and in order to keep the code well organized and easily maintainable, I decided to divide the code between multiple projects within the solution in Visual Studio 2017.
After editing a file within the child projects and building it, Unity throws up all sorts of errors regarding the UI and the editor just seems to stop working properly, forcing me to restart it, which seems to fix the problem until the next save.
I have been able to reproduce this constantly and the errors are always the same.
The bug report case number is 906634.
Screenshots
Has anyone else encountered these problems?
Best regards,
Andrei Hava
It’s been a while since I did such a project. IIRC, I needed to have the additional projects deposit their DLLs in a Plugins directory in the Unity project’s Assets.
Remember that the code Unity actually runs is compiled by Unity using Mono–in up to four separately-compiled Assemblies built in this order (It’s possible 2&3 are swapped):
- Assembly-CSharp-firstpass (Game.Plugins.csproj)
- Assembly-CSharp-Editor-firstpass (Game.Editor.Plugins.csproj)
- Assembly-CSharp (Game.csproj)
- Assembly-CSharp-Editor (Game.Editor.csproj)
This means that code in any of these assemblies are only able to access things compiled in an earlier assembly. Each of these .csproj files also references any pre-compiled assemblies whose DLLs are in an Assets/Plugins directory.
This also means that while any other projects are being built by Visual Studio, those assemblies will be run by the Mono runtime rather than the Windows runtime, and the four assemblies mentioned above will be built by Unity–not Visual Studio.