There will be times when you want to share a collection of assets with other users on your team or within the community. Unity makes this easier by providing a simple mechanism called Packages. Apackage is just a collection of assets bundled together in a single file.
In this exercise we're going to explore how one would share assets from an existing project with other developers:
Open the project for this chapter named HelloWorld2. In it you will find a version of our original Hello World demo with some additional assets.
Select the assets that you want to export as part of the package:
In the above illustration the Materials element within the Project has been selected. There are Puppy and Grass materials that are a child of the Materials element and they will be bundled in the package as well. If you only wanted to share the Puppy materials you would simply select the Puppy element and only those materials would be packaged.
Next let's create a package using the Export Package menu (Assets | Export Package). When selected, this will create a package starting with the selected item in the Project view and anything that is a child of this element.
Unity will then display a dialog with all of the assets that will be exported. If there are assets that you want to remove, uncheck its checkbox:
In addition, there is a checkbox labeled Include dependencies. If your assets have other assets, such as scripts, that they depend on, keeping this box checked tells Unity to include those assets in the package.
Select theExport button and, in the subsequent file dialog, provide a name for the Unity package file. Unity will create and compress the assets into a file with the extension .unitypackage:
What just happened?
We have created a Unity package that contains all of the assets we selected. This is the ideal way to share assets with your team as any settings, hierarchies, and so on will be preserved when those assets are imported.