UpgradeLib
API To ease the creation of upgrades, shop items etc.
About this mod Author’s original text
UpgradeLib Developer Guide
Overview
UpgradeLib is a small library that handles the registration and unloading of upgrades for your project.
Using UpgradeLib for Plugin Development
- Download the.dll:
- Download the.dll file and move it to the current working directory of your plugin.
- Link the.dll in your csproj:
UpgradeLib.dll
Usage
- Initialize UpgradeLib:
- Typically, this is done in your mod’s Awake method:
UpgradeLibManager.Init("com.yourname.yourmod");
- Create and register an upgrade:
var myUpgrade = new UpgradeDefinition(
id: 10001,
internalName: "MY_UNIQUE_UPGRADE",
title: "Example Upgrade",
description: "Does something special when purchased.",
price: 500,
stackable: false,
onPurchased: (fromSave) =>
{
// Code to run when the player unlocks or loads this upgrade
},
onLockedAllUpgrades: () =>
{
// Code to handle logic when all upgrades are locked (e.g., on game over)
}
);
UpgradeLibManager.RegisterUpgrade(myUpgrade);
TODO / Needs Testing
- Multiplayer support has not been tested. Please test and report any issues.
Contact
If any issues occur, feel free to DM me on Discord: rammmmy.
Install & use Install: follow the bundled instructions
- Unzip the archive from playbuff and read the bundled readme / instructions first.
- Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
- For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
- Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.
Install locations vary a lot between mods — the bundled readme is the most reliable guide.