The build system reads the
ChroMapperDir environment variable to locate ChroMapper’s assemblies and to copy your DLL after a successful build. Make sure it is set before you open your IDE or run any build commands. See Prerequisites for setup instructions.Set the ChroMapperDir environment variable
If you have not done this yet, set For a permanent setting, see Prerequisites.
ChroMapperDir to the full path of your ChroMapper installation directory — the folder that contains ChroMapper_Data\Managed\.Install the template
Clone the repository, then run You should see output confirming the template was installed:
dotnet new install from the repository root to register the template with your local .NET CLI:Create a new plugin project
Run This creates a
dotnet new chromapperplugin with the -o flag to set the output directory and --Author to stamp your name into the generated code:MyPlugin\ directory containing a ready-to-build C# project.Open the project in your IDE
Open the generated Once loaded, your IDE resolves all ChroMapper and Unity references from
.csproj file in Visual Studio or Rider:$(ChroMapperDir)\ChroMapper_Data\Managed\. If any references show as unresolved, double-check that ChroMapperDir is set and that your IDE was launched after the variable was set.Review the generated entry point
Your project contains a single source file, Key points:
Plugin.cs, with this content (with YourName replaced by whatever you passed to --Author):Plugin.cs
[Plugin(Name)]registers the class with ChroMapper’s plugin loader.[Init]marks the method ChroMapper calls when it initialises your plugin.Harmony.PatchAllscans your assembly and applies every[HarmonyPatch]class you add.
Build the project
Build using your IDE’s build command, or from the command line:After a successful build, MSBuild runs a post-build step that copies your DLL directly into ChroMapper’s You do not need to copy the file manually. Check your ChroMapper
Plugins directory:Plugins\ folder — your DLL should be there.Next steps
Your plugin is running. From here you can start extending ChroMapper:Harmony patching
Intercept and modify ChroMapper methods at runtime
Unity integration
Work with GameObjects, UI, and the Unity event system
Project structure
Understand the generated files and how they fit together
Build and deploy
Configure Debug vs Release builds and the auto-deploy step