Package Installer
Last updated - 27th April 2023
Overview
The platform installer system provides a robust way to deploy configuration and assets from a Unity Package in to a runtime solution, it also provides cross-package capabilities between different packages using the Package Installer to deploy dependent configuration on demand.
This is what this article will cover:
Package Installer Overview
At its core, the Service Framework provides a Package Installer system which can detect and react to Package Installer Profiles to deploy configuration and assets to a solution and other packages implementing a Package Installer Profile.
Core components
The Package Installer framework is built up of the following components:
Package Installer Profile
The PackageInstallerProfile
is a scriptable object asset type that defines IService
's and IServiceModule
's that a package exposes for use with the ServiceManager
.
Package Installer Component
The PackageInstaller
will install IService
's and IServiceModule
's defined in a PackageInstallerProfile
to the project.
Asset Installer
The AssetInstaller
will install assets, such as Prefabs, Meshes, Textures etc. that come with a package into the project's Assets directory.
Package Module Installer
Each package that wants other developers to be able to install their own IServiceModule
's into their services, must define and implement a IPackageModuleInstaller
that will take care of the installation.
Examples
The
com.realitytoolkit.camera
package comes with theCameraService
. It defines aPackageInstallerProfile
that will make use of thePackageInstaller
to install theCameraService
to the project. In this scenario we DO NOT need aIPackageModuleInstaller
since the camera package has full authority over the camera service and its modules.The
com.realitytoolkit.pico
package comes with aPicoInputServiceModule
that can be registered with theInputService
. TheInputService
is a service that is outside of the PICO package's authority, since it lives in thecom.realitytoolkit.core
package. That's why the PICO package must ask theCorePackageModuleInstaller
, which is aIPackageModuleInstaller
implementation, to install thePicoInputServiceModule
to theInputServiceProfile
.
More information
for more information on the Service Framework, check out these additional links: