Creating a Package

This section explains how to create a Unity package ready for upload to pckgs.io. Unity packages require a specific folder structure and metadata in a package.json file. Following these steps ensures your package will be recognized by unity and pckgs.io properly.


How to Create a Package

  1. Open Your Unity Project: Open your Unity project or create a new one.

  2. Create Package Directory:
    A Unity package is defined by its package.json file, which must reside at the root of your package’s dedicated directory.

    • Create a new folder (e.g., MyAwesomeTool) at your Unity project’s root level as your package’s main directory.
    • Inside this folder, create a package.json file with all the necessary metadata for your package. Check out the official Unity Package Manifest documentation to see exactly what fields you need and how to structure it.
  3. Naming the Package:
    Each Unity package is uniquely identified by the name key in its package.json. This name must follow pckgs.io’s scoped package naming convention:

    • Start with the scope prefix for your organization (e.g., com., net., org., io.)
    • Followed by your organization’s slug (unique identifier on pckgs.io)
    • Then your package’s specific name

    Examples:

    • com.my-company.my-package
    • org.my-company.awesome-tool
    • io.your-team.utility-kit
  4. Versioning:
    The package version is specified by the version key in package.json. Always use semantic versioning (e.g., 1.0.0, 1.0.1, 2.0.0). Uploading the same version again will cause an error; new versions are added as updates.

  5. Including Package Content:
    Place all assets, scripts, scenes, and other necessary files inside the package folder.

That’s it! Your package is now ready. For more detailed information, please refer to the official Unity documentation on Creating Custom Packages and Package Manifest.


See Also