Libraries can be used to create self-contained code and assets that you can reuse in multiple projects. These can be shared with your organisation or with the whole community.
Libraries are stored in the Libraries
folder in your project. Each library has its own folder, with its own Assets
, Code
, and Editor
folders.
The game code, and game's editor code reference all installed libraries, so it can access any classes you define in the library. But a library cannot access the game code directly.
Libraries are not compiled assemblies. When you share your library you are sharing the source code. You are sharing everything in the library folder.
Libraries aren't downloaded and restored automatically. The expectation is that you download a library to your <project>/Libraries/
folder, and you then commit that to your source control.
There are multiple benefits to the library system working in a way where you download it and store the code yourself.
You can open the Library Manager
tab from the View
menu.
This tab lets you see installed libraries, update them, remove them.
It also lets you browse available libraries and install them.
Libraries can be published like any other package. Right-click the library in Library Manager and select Publish Project. The standard project visibility rules apply, so no-one outside your org will be able to see it unless you make it public.
Libraries cannot reference other libraries. If you are thinking of shipping a library that relies on another library - don't. It isn't supported.