Embedded dependencies
Embed a package in your project to make it mutable.
Read time 3 minutesLast updated 23 days ago
Any package that appears under your project's folder is embedded in that project. You can create an embedded package in several ways:
Packages- Create a new package directly in your project's folder.
Packages - Place a copy of a Unity package in your project's folder.
Packages - Use a C# script to embed a version of a package that's already installed.
Embedded packages don't need to appear in the project manifest as a dependency. However, if you embedded a version of an installed package, your project manifest still lists the dependency on the original installed version. In that case, the package on disk takes priority over the version of the package listed as a dependency, so it doesn't need to be removed from the project manifest. For example, if the project manifest specifies a dependency on version 1.3.1 of the package but the project also has an embedded package with that name, the Package Manager uses the embedded package, regardless of its apparent version, instead of downloading version 1.3.1 from the registry.
com.unity.exampleMake sure you track the contents of your embedded packages, and any changes you make to it. If your Unity project is under source control, add any packages embedded in that project to the same source control.
Create a new custom package
To embed a new package, create your new package content inside a folder under the folder. For more information, follow the instructions for creating your own custom package.
PackagesTypically, your new package remains embedded in your project until you are ready to share it with other users and test it in other projects. You can use different methods to share your package, for example, you can host the package on a scoped registry.
Copy a Unity package to your project folder
A package installed from a registry is immutable, which means you can't edit it. If you want to edit a package, you can make it mutable by copying it to the subfolder in your project folder. This package type is called an embedded package, and it overrides what's in your package cache. Later, you can delete that embedded package's folder from the subfolder, and the Package Manager will automatically change to the immutable, cached package.
PackagesPackagesTo copy a Unity package to your project folder:
-
Use the Package Manager window to select the UPM package you want to copy from the Unity Registry or In Project context.
-
Open the Manage dropdown in the details panel.
-
Select Customize.
The package now appears with the Custom label. You can edit the package, which was copied to the folder of your project.
PackagesYou can delete the embedded package and the Package Manager will automatically revert to the immutable, cached package. Consider backing up the folder for the embedded package, otherwise you'll lose any changes you made to the package. Use either of the following methods to delete the embedded version of a package:
- Use the Package Manager's Manage dropdown to Remove the embedded package.
- Use your file browser or command line to locate the folder of your project. Then, delete the folder for that package from your
Packagesfolder.Packages