The
[Plugin] and [Init] attributes are defined in Plugins.dll, which ships with ChroMapper and is located at $(ChroMapperDir)\ChroMapper_Data\Managed\Plugins.dll. Your project references this assembly via the ChroMapperDir environment variable.Complete Plugin.cs reference
The template generates the following entry-point file:Plugin.cs
Attributes
[Plugin(Name)]
Marks a class as the plugin entry point. ChroMapper scans loaded assemblies for classes decorated with this attribute and registers them as plugins.
The single argument is the plugin display name — the string that appears in ChroMapper’s plugin list. In the template this is the Name constant, so it always matches the project name after substitution.
public.
[Init]
Marks the method ChroMapper calls immediately after loading the plugin. Place your one-time startup logic here: initializing Harmony, registering event handlers, or logging a startup message.
private. ChroMapper invokes it via reflection.
Plugin.ID convention
TheID constant follows the reverse-domain convention com.{Author}.{Name}:
Harmony integration
new Harmony(ID)
Creates a Harmony instance scoped to your plugin’s ID. All patches registered through this instance are grouped under that ID, making them easy to un-patch selectively if needed.
.PatchAll(Assembly.GetExecutingAssembly())
Scans your entire assembly for classes annotated with [HarmonyPatch] and applies all the patches it finds. You do not need to list individual patch classes — Harmony discovers them automatically.
Logging
Debug.Log is from UnityEngine.CoreModule. ChroMapper runs on Unity, so Unity’s logging pipeline is available. Log output appears in the ChroMapper console and in Player.log.
Debug.LogWarning and Debug.LogError for higher-severity messages.
AssemblyInfo.cs
The template includes aProperties/AssemblyInfo.cs file with standard .NET assembly metadata attributes:
Properties/AssemblyInfo.cs
AssemblyVersion and AssemblyFileVersion are the values you increment when you release a new version of your plugin. See Configuration for details on updating them.