This is a template for creating UPM packages. We use this for developing and maintaining our Unity packages.
- Use this repository as a template for your new package
- Clone the repository to your local machine
- Run the
bootstrap.sh
(orbootstrap.ps1
for Windows) script to rename assemblies and namespaces.- This will replace the
Template
name with your package's name - Name must not contain whitespace
- These scripts can be deleted after running
- This will replace the
- Modify the
package.json
file to define your package, this is not modified by the bootstrap script - Modify the
README.md
andDocumentation/Template.md
files to include your package's info - Develop your package
If developing and maintaining multiple packages, it's recommended to have Unity projects for each major Unity version that is supported, and import each package into the project as a local package.
Package Manager -> + -> Add package from disk...
This allows you to make changes to the package and see the effects in the Unity Editor immediately. It also allows
Unity to generate the necessary .meta
files for the package, without having to move the package back and forth
from Assets
to Packages
.
When publishing to the Asset Store, use the Hybrid Packages format to support both UPM and Asset Store installations.
If publishing elsewhere, or deploying for internal use, the package can be deployed as-is within scoped registries or using the Git URL.
The Documentation
and Samples
folders will be packaged with the UPM package, but should be renamed to
Documentation~
and Samples~
before uploading/publishing the package.
This is to prevent the folders from being automatically imported into the Unity project when the package is imported and allows the user to decide if they want to import them or not.