-
-
Notifications
You must be signed in to change notification settings - Fork 2
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.
- 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.
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.
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 exampleGameText.Guid. -
ModFramework.Registeradds your description, authors, website and icon to the Mods screen. Without it, your mod is still listed, just with less. -
Config.Bindentries of typebool, numbers,stringand enums (andAcceptableValueList/AcceptableValueRange) get controls on the Settings tab. To hide an entry, tag it with an object that hasBrowsable = false. -
GameOptions.AddToggleandAddChoiceadd rows that follow the game's own Save and Back buttons. See Core API.
- Build, and copy your DLL (and
icon.png) toBepInEx/plugins/MyMod/. - Start the game. The mod count on the title screen goes up by one.
- Open Options → Mods, select My Mod, and check that the description, icon and Settings tab are there.
- Look for your mod's lines in
BepInEx/LogOutput.log.
- To change text, react to dialogue or add a debug tab, see Text, Dialogue and Tool window.
- To load textures or fonts, read Assets first. On Direct3D 12 the timing matters.
- Before you release, read Playing well with others.
Players
Mod authors
- Getting started
- Playing well with others (the guide)
- Going online
- Installer
- Mod reload
- Overrides (no code)
- Graphs (no code, makes things happen)
Tools (F1, developer tools)
- Inspector
- Console
- Code graph
- Bridge (AI clients, MCP)
API
日本語
- ホーム
- プレイヤー向け · ランチャー · FAQ · クラッシュレポート
- はじめての Mod · ほかの Mod と一緒に動かす · 外と通信する Mod · インストーラー · Mod の再読み込み · Overrides · Graphs
- Inspector · Console · コードのグラフ · Bridge
- 中核 API · 操作の登録簿 · Text · Dialogue · Tool window · Assets · Flags and saves · GameEvents · SettingMeta
Links
- Repository
- Releases
- Changelog
- Design records: DESIGN · ROADMAP · CONTENT_POLICY