DevBlog #2 – Package workflows, OpenUPM and more

I’ve been a huge proponent of the new Package-based workflows that Unity added a few years ago.  I’m pretty convinced that the package manager team watches in horror at the things I’m trying to accomplish with packages on a daily basis.

I’m either their biggest fan or biggest nightmare, I’m not entirely sure – but I’m absolutely convinced that package-based workflows are critical to not only Unity’s development going forward, but also for developers USING Unity.

Much of what I’ll discuss in the devblogs will revolve around how to scale a Unity project to a massive scale using Packages, so if this is a topic that interests you – definitely let me know and I’ll be sure to ramble on about that ad nauseum ;}

OpenUPM

One of the biggest challenges for me has been the fact that for a proper package-based workflow, you need a scoped registry to point Unity at so it can pull the packages. Unity hosts their own packages, but this is only for internal, ‘Unity sanctioned’ packages – mere mortals can’t host their own packages, and there are requirements for Unity devs to host their own packages as well (for good reason – Unity has to be able to qualify and guarantee quality for packages provided to our customers, random side projects and hackweek style experiments don’t meet the requirements) .

I had experimented with hosting my own package registry – since Unity’s registry is ‘basically’ NPM, any NPM registry should work for your own package hosting. However…hosting your own registry has cost, security and maintenance implications. I’ve been traumatized enough running dev ops for a number of studios to know that ‘I ain’t want none of that’.

At some point I’ll discuss how to setup and run your own scoped registry (it is a key piece of the puzzle), but…later…

So what are the rest of us to do?

Enter OpenUPM – the ‘Open Source Unity Package Registry’ – www.OpenUPM.com

Openupm.com

Interestingly enough – OpenUPM isn’t the ONLY 3rd party package registry designed specifically for Unity developers available, but it’s the one that I’ve decided to start using to host all of the open source packages that I’ve been working on.

Using OpenUPM for your own projects is very simple to setup (as long as doing some minor configuration with NodeJS isn’t too terrifying for you), and once you have your workstation setup for it, you can add new packages to a project with a single command (which you can open from the package details page on OpenUPM), like so:

PixelWizards Utilities Package details

Simply copying this one line and pasting it into a command prompt adds the package to your project’s manifest and you’re ready to go:

openupm add com.pixelwizards.utilities

There are hundreds of packages available on OpenUPM – I have 4 (ish?) packages on OpenUPM as of this writing, and every new package / utility that I post to github, I make sure to add it to the registry as well – for my own use, as well as for anyone in the community.

After all, it’s the community that has always made Unity my favorite development platform to work on, and anything I can do to help foster and support the community, the better.

Until next time!