

A simple mod that adds self-revival upgrade. You buy this expensive upgrade in the shop, and then use it. You get a stack of SELF REVIVE. Once you die, and you have more than one SELF REVIVE stacks, that stack decreases and respawns you with all of the items in your inventory in the truck.
This mod relies on REPOLib to add the upgrade and the item upgrade.
It's been a quite complicated journey, so I'd like to share how I achieved adding an upgrade in REPO with REPOLib.
Assets/ for your mod name.REPOLib > Mod in your mod folder.ItemContent, Item Prefab and Item. See below for more information on how to setup that..csproj include the bundle like <ItemGroup><EmbeddedResource Include="bundle\selfreviveupgrade"/></ItemGroup>.repoharmony mod, you can load the bundle from embedded bundle, see SelfReviveUpgrade.RegisterBundledItemAndUpgrade() for more information.REPOLib as well.And that should be it! The rest is up to you what you are going to do with the logic.
While creating ItemContent and Item is covered by the wiki, it was a bit tricky to setup the item prefab (the object itself), so here is a breakdown:
Assets/REPO/Game/Prefabs/Item Upgrae Player Grab Strength.prefabAssets/REPO/Game/Materials/upgrade_strength.matAssets/REPO/Game/Textures/Texture2Ds/Upgrade_Grab-Strength_Albedo.png.mat) and drag and drop albedo into Albedo in the sidebar..prefab, and find in the Hierarchy Mesh. Expand Materials and drag and drop over your .mat copy (it took me a while to make my prefab display the correct texture)..prefab, click the root element in Hierarchy (in my case it was Item Prefab, and in Inspector you should see Photon View, Item Upgrade (Script), Item Toggle (Script) and other components).
That should be it. No need to implement your own class for incrementing your own upgrade stat or creating a patch for it. Congratulations on creating your own upgrade! 🎉
Простой мод, который добавляет улучшение самовоскрешения. Вы покупаете это дорогое улучшение в магазине, а затем используете его. Вы получаете стопку SELF REVIVE. Когда вы умираете и у вас больше одной стопки SELF REVIVE, одна стопка расходуется, и вы возрождаетесь со всеми предметами из вашего инвентаря в грузовике.
Этот мод использует REPOLib для добавления улучшения и его предмета.