Skip to content

Thundernerd/Unity3D-PackageManagerModules

Repository files navigation

Package Manager Modules

GitHub package.json version GitHub issues GitHub pull requests GitHub license GitHub last commit

A toolkit to create modules for the Package Manager Window.

Installation

  1. The package is available on the openupm registry. You can install it via openupm-cli.
openupm add net.tnrd.packagemanagermodules
  1. Installing through a Unity Package created by the Package Installer Creator from Needle

Usage

Creating a module

To create a module you need create a class that implements the IPackageManagerModule interface.

These classes get automatically picked up and added to the module menu which can be located at the top of the Package Manager Window

Modules menu underlined

Identifier

The identifier of your module should be unique and only be used for one package. I recommend using the reverse domain name notation for this.

DisplayName

The display name of your module is what will be shown in the modules menu. If you plan on creating multiple modules then you can group them together by using a / (forward slash)

e.g. Foo/Bar, Foo/Baz, Foo/Qux

These will all be grouped together under Foo

IsEnabled

This is to identify if your module is enabled. You have to keep track of this yourself in your module. This will be reflected in the modules menu.

Initialize()

This is called when the modules are created and should be used for initialization logic only.

Dispose()

This is called when the Package Manager Window closes or when the editor starts recompiling. Use this to clean up things like event subscriptions.

Enable()

This is called when the user enables your module through the modules menu.

Disable()

This is called when the user disables your module through the modules menu. This will also be called when the Package Manager Window closes, or when the editor starts recompiling.

Sample

This package comes with a Dependencies Editor sample. This sample allows easy editing of the dependencies of a package that is in development. You can import the sample through the Package Manager Window.

Dependencies editor sample

Support

Package Manager Modules is a small and open-source utility that I hope helps other people. It is by no means necessary but if you feel generous you can support me by donating.

ko-fi

Contributing

Pull requests are welcomed. Please feel free to fix any issues you find, or add new features.