I am including an instance of the same source files in multiple assemblies using the Add As Link option. I specifically need to include an instance of the same source withi
I had this error but not with 2 different classes!
Each new class where in conflict with itself, so obviously I had that CS0436 Error
.
After some struggling found out that it was about Mirror Asset
that I was using in my multiplayer Unity project. Mirror somehow was including every new class that I make (and inherit from NetworkBehavior
).
My external editor was VSCode
(visual studio code, solution might also apply to visual studio).
Solution
in
Edit / Preferences / External tools / "Generate .csproj files for:"
I started testing different settings, and this worked for me:
(Not sure if the exact settings work for all, but not having the right files in project, leads to this error. like my case.)
Click Regenerate project files
and restart Unity and VSCode after applying these settings (or the setting that suits your project).