
R.E.P.O.
You are viewing a potentially older version of this package. View Latest Version

If you need support for my mods or just want to hang out join my new personal server on Discord: https://discord.gg/TnruJeXdAw
Developers Only: This is an API for loading your custom shops. You still need to create your own shop Prefab. This API handles the loading, networking, and integration for you.
[Registered Shops] in the com.Empress.ShopAPI.cfg file.LevelGenerator and handles the ResourceCache for both singleplayer and multiplayer pools.Since version 1.1.0, this API overrides the default Shop Start Room. Because of this, you must follow these rules to prevent the game from crashing:
[BepInDependency("com.Empress.ShopAPI")] to your plugin metadata.ShopAPI.RegisterShop in your Awake method.using BepInEx;
using UnityEngine;
using Empress_ShopLoaderAPI; // Reference my API namespace
using System.IO;
[BepInPlugin("com.YourName.MyCoolShop", "My Cool Shop", "1.0.0")]
[BepInDependency("com.Empress.ShopAPI")]
public class MyShopPlugin : BaseUnityPlugin
{
private void Awake()
{
string bundlePath = Path.Combine(Path.GetDirectoryName(Info.Location), "my_shop_bundle");
AssetBundle bundle = AssetBundle.LoadFromFile(bundlePath);
if (bundle != null)
{
GameObject myShopPrefab = bundle.LoadAsset<GameObject>("MyShopPrefabName");
if (myShopPrefab != null)
{
// Register your prefab (ensure it has the TRUCK object inside!)
ShopAPI.RegisterShop(myShopPrefab, "YourName/MyCoolShop");
}
}
}
}
Credits