At some point you might meet the situation, when you have created nice ifrastructure for typical projects you do, and you want to share that functionality between all the projects. One important addition, is to always keep that system up to date, in case there are some bugs — fix them, and then make sure all of your projects have got rid of that bug.
Of course you can store your functionality, as assets package. But this way, you wont be able to update your projects in an efficient way. You would need manually to go to every project, and update your package over there. This is really uncomfortable.
We here at UseCookie, are big fans of Git. Of course, it might be sometimes tricky, sometimes it is buggy(mostly LFS), but when you have set that properly up — it is really flexible and is brilliant versioning control system.
So,back to our topic, we do always use Git Submodules for the code shared between the projects.
For Example, we have flexible InputModule, that provides just singleton InputManager, and send events for input actions. You can subscribe to events, block some of them, disable all the controls, ensure you are not on UI and so on. System is flexbile, and we use that everywhere.
InputModule is git repository, with the same name.
The project you are working on is a git repository as well(if not — what are you waiting for, make it git!).
So now, you just need to setup Submodule for it.
We are using Sourcetree, and recommend to use that as well.
Please refere to following guide, it is just 3 steps, https://confluence.atlassian.com/sourcetreekb/adding-a-submodule-subtree-with-sourcetree-785332086.html
Now, when you have added a submodule to your project, just switch to submodule, and clone, if that has not been cloned.
That is it, you have succesfully added Submodule to your Unity project.
Please, be careful in modifying source code of your submodules, as other projects are dependant on that code as well, so you should keep in mind, that the code must be as generic and independent as possible.
Have a good weekened!