DEV Community

Cover image for The secret to publishing UPM package to the Asset Store
dreamcodestudio
dreamcodestudio

Posted on

The secret to publishing UPM package to the Asset Store

πŸ“˜ Unity native solution

In 2018, Unity's developers released a centralized repository for iterative updates to their Editor engine and extensions called UPM - Unity Package Manager.

Later, third-party services appeared through which UPM packages were distributed:

Separately, NuGetForUnity can be highlighted, which runs the NuGet client within the Unity editor.

Despite this, more than 93 thousand assets and extensions have been published on the Asset Store, but it does not officially offer UPM package downloading functionality.

🎯 Seeking a solution

Asset Store Tools v11.3.1, allows you to download assets from the following sources:

  • From Assets Folder
  • Pre-exported .unitypackage

upload-type

Looking through the sources of the Asset Store Tools, we see the experimental functionality wrapped in the

#if UNITY_ASTOOLS_EXPERIMENTAL directive:

experimental-define

The functionality has already been on the Unity side, but it is not available to third-party developers:

define-example

Meanwhile, Unity Technologies developers load their own assets in the form of UPM packages:

asset-tools-hierarchy

To achieve a similar result, follow these steps:

1 - Create a draft package using the Unity Publisher Portal:

draft-package
assets-store-uploader

2 - Add the value UNITY_ASTOOLS_EXPERIMENTAL to Project Settings > Scripting Define Symbols:

scripting-define-symbols:

3 - After compilation is complete, select the option to load the local UPM package and specify the package path:

package-path

4 - Click the Upload button and πŸŽ‰:

smart-importer-preview

πŸ’» Conclusion

The type of download using UPM packages is suitable for assets or tools that have version control and configure dependencies between packages.

This results in a uniform asset structure for the Unity Package Registry and Asset Store.

In future Unity releases, it is likely that an open solution will be published for publishers.

🎁 Helpful Links

Guide

Smart Importer

Asset Store Tools

Unity’s Package Manager

Top comments (0)