Skip to content

Getting started

Tom_XV edited this page Sep 23, 2026 · 4 revisions

English | 日本語

This page takes you from an empty project to a mod that shows up on the Mods screen with a setting and a row in the game's Options screen.

1. What you need

  • The .NET SDK, and an editor that builds C# (Visual Studio, Rider, VS Code).
  • Drag'n Wash with BepInEx 5.4.23.5 and the framework installed (see For players).
  • A BepInEx 5 plugin project targeting net472.

2. References

Reference these from your game folder, with Copy Local / Private = false so you never ship them:

DLL From
BepInEx.dll, 0Harmony.dll BepInEx/core/
UnityEngine.dll, UnityEngine.CoreModule.dll (and other modules you use) DragNWash_Data/Managed/
DragNWash.ModFramework.dll BepInEx/plugins/DragNWash.ModFramework/
A library DLL, for example DragNWash.ModFramework.Text.dll BepInEx/plugins/DragNWash.ModFramework.Text/
<ItemGroup>
  <Reference Include="DragNWash.ModFramework">
    <HintPath>$(GameDir)\BepInEx\plugins\DragNWash.ModFramework\DragNWash.ModFramework.dll</HintPath>
    <Private>false</Private>
  </Reference>
</ItemGroup>

Never commit the game's DLLs to your repository.

3. The plugin

using System.IO;
using BepInEx;
using BepInEx.Configuration;
using DragNWash.ModFramework;

[BepInPlugin(Guid, "MyMod", "1.0.0")]
[BepInDependency(ModFramework.Guid, BepInDependency.DependencyFlags.HardDependency)]
public class MyMod : BaseUnityPlugin
{
    public const string Guid = "com.example.mymod";

    private ConfigEntry<bool> _fastMode;

    private void Awake()
    {
        // What the Mods screen shows. Register from Awake so the icon loads at startup.
        ModFramework.Register(new ModInfo
        {
            Guid = Guid,
            DisplayName = "My Mod",
            Description = "One or two sentences on what it does.",
            Authors = new[] { "Me" },
            Website = "https://github.com/me/mymod",
            UpdateRepository = "me/mymod",
            IconPath = Path.Combine(Path.GetDirectoryName(Info.Location), "icon.png"),
        });

        // BepInEx settings become the Settings tab on the Mods screen.
        _fastMode = Config.Bind("General", "FastMode", false, "Scrub twice as fast.");

        // The same setting as a row in the game's own Options screen.
        GameOptions.AddToggle(Guid + ".fastmode", "Fast Mode",
            getSaved: () => _fastMode.Value,
            save: value => _fastMode.Value = value);

        ModFramework.Ready += () => Logger.LogInfo("Framework ready.");
    }
}

What each part does:

  • [BepInDependency(ModFramework.Guid, HardDependency)] makes BepInEx load the framework first, and refuse to load your mod with a clear message when it is missing. Add one for every library you use, for example GameText.Guid.
  • ModFramework.Register adds your description, authors, website and icon to the Mods screen. Without it, your mod is still listed, just with less.
  • Config.Bind entries of type bool, numbers, string and enums (and AcceptableValueList / AcceptableValueRange) get controls on the Settings tab. To hide an entry, tag it with an object that has Browsable = false.
  • GameOptions.AddToggle and AddChoice add rows that follow the game's own Save and Back buttons. See Core API.

4. Install and try it

  1. Build, and copy your DLL (and icon.png) to BepInEx/plugins/MyMod/.
  2. Start the game. The mod count on the title screen goes up by one.
  3. Open Options → Mods, select My Mod, and check that the description, icon and Settings tab are there.
  4. Look for your mod's lines in BepInEx/LogOutput.log.

Next

Clone this wiki locally