How do you address code sharing across your unity projects?

Hello,

I am wondering how most of you approach sharing common functionality across your unity projects?
Do you develop .NET class libraries along the way?
If so, how do you get to use the UnityEngine dlls as part of your library?
For example, do you keep a local copy of the dll which you reference by filesystem location and etc (as I was doing for some time). What best practices would you recommend when you want to switch to a newer Unity version?
Is there a way to enable library sharing with the new assembly definitions / (.asmdef) and how?

I have personally used class libraries successfully for a couple of years now. However,
I ran recently into an issue (see here: Issues with UnityEngine.UI when referenced in a class library, since Unity 2019 - Questions & Answers - Unity Discussions), and I am starting to wonder whether the class library approach is still suitable for modern unity development. That is why I am creating a poll in order to get a better picture on the matter.

I’d love to see you share your thoughts on the topic.

All of them - except NuGet - but instead UPM via package manager.

1 Like

Package Manager packages and git submodules.

1 Like

@Peter77 , Nice bringing the git submodules on the table :slight_smile: Besides the submodule do you also do any work in regards to linking the submodule contents to the unity project (like symlinking or autmated copying). Or maybe you checkout the submodule in the appropriate location within the Assets folder?

This. I checkout the submodule in the appropriate location within the Assets folder.

2 Likes