Requirements

Selvage has the following requirements:

  • Unity 6.0 or later.
  • Any build target, with the Mono or IL2CPP scripting backend.
  • The Mono Cecil package (com.unity.nuget.mono-cecil) 1.10 or later. Selvage's compilation step uses it to inject your members. Importing Selvage installs it if your project doesn't have it.

The following packages are optional:

PackageUsed for
Addressables (com.unity.addressables) 1.19 or laterProviding addressable assets. For more information, refer to When Selvage loads an asset.
Unity UI (com.unity.ugui)The demo.

Install the package

To install Selvage, perform the following steps:

  1. Go to Window > Package Manager.
  2. Select My Assets, then select Selvage.
  3. If the package isn't downloaded yet, select Download.
  4. Select Import.
  5. In the Import Unity Package window, select Import.

When the import finishes, Selvage is active.

If the Console window displays Selvage: automatic injection is off with a message that names the Mono Cecil package, the package is missing, for example because it was cleared in the import dialog. To add it, perform the following steps:

  1. Go to Window > Package Manager.
  2. Select + > Install package by name.
  3. Enter com.unity.nuget.mono-cecil, then select Install.

Selvage menus

Selvage adds the following menu items to the Unity Editor:

The Tools > Selvage menu, with Settings, Dependencies, Quick Usage Guide, User Manual and Public API
Menu itemDescription
Tools > Selvage > SettingsOpens the Selvage page of the Project Settings window. For more information, refer to Project Settings reference.
Tools > Selvage > DependenciesOpens the Dependencies window. For more information, refer to Dependencies window reference.
Tools > Selvage > Quick Usage GuideOpens the Quick Usage Guide.
Tools > Selvage > User ManualOpens the User Manual.
Tools > Selvage > Public APIOpens the Public API reference.
Assets > Create > Selvage > Provide DefinitionCreates a Provide Definition in the selected folder. For more information, refer to Provide assets.
Component > Selvage > Provide TuningAdds a Provide Tuning component to the selected GameObject. For more information, refer to Provide Tuning reference.

Package contents

Selvage installs into Assets/Selvage, which contains the following folders:

FolderContents
RuntimeThe Selvage runtime.
EditorThe Dependencies window, the Selvage page of the Project Settings window, and the Inspector window additions.
CompatibilityModules for migrating a project from Zenject or VContainer. Each compiles only when its container is in the project.
ToolingThe compilation step that injects your members, and the code analysis.
Editor/Test CallbacksConnects Selvage to the Test Runner: the [Provide] classes of the tests that run apply during the run, and a provider a test adds is removed when the test ends. Applies to tests run in the Editor, not on a player. Compiles only with the Test Framework package.
TestsSelvage's own tests. They compile only when the project defines SELVAGE_TESTS. For more information, refer to How do I run Selvage's tests?
DemoThe demo scene and its scripts. For more information, refer to Explore the demo.
DocumentationThe Quick Usage Guide, the User Manual, and the Public API reference.