11# EasyPackageAPI
22
3- API for adding custom packages to easy delivery co.
3+ API for easily adding custom packages to easy delivery co.
44
5- This mod does not add any packages of its own
5+ This mod does not add any packages of its own.
66
77## How To Use
88
9- ### Example
9+ ### Preamble
1010
11+ The registering of a custom package with the API is extremely easy, however the setup for a creation
12+ for a prefab is a quite tedious process.
13+
14+ I'm not going into details for this rn, but basically you would need to do these things:
15+ 1 . Extract the assets using a tool from the game
16+ 2 . Create a Unity project and import the required assets for a package
17+ 3 . Use an existing prefab as a template and modify it however you want
18+ (makes it easier than recreating one from scratch)
19+ 4 . Export your package(s) as a Asset Bundle
20+
21+ ### Loading And Registering
22+
23+ #### Example Plugin.cs
1124``` csharp
1225[BepInPlugin (MyPluginInfo .PLUGIN_GUID , MyPluginInfo .PLUGIN_NAME , MyPluginInfo .PLUGIN_VERSION )]
26+ [BepInDependency (EasyPackageAPI .MyPluginInfo .PLUGIN_GUID )]
1327public class Plugin : BaseUnityPlugin
1428{
1529 internal static ManualLogSource Log ;
@@ -28,6 +42,7 @@ public class Plugin : BaseUnityPlugin
2842 RegisterPackages ()
2943 }
3044
45+ // for loading your asset bundle. you can do this however you want
3146 private void LoadAssets ()
3247 {
3348 // ideally put your assets in a assets sub directory but it can be anywhere
@@ -42,15 +57,16 @@ public class Plugin : BaseUnityPlugin
4257 packageTwo = myAssetBundle .LoadAsset <GameObject >(" Package Two" );
4358 }
4459
60+ // registering your packages
4561 private void RegisterPackages ()
4662 {
4763 // add a package to multiple shops
48- PackageRegister . RegisterPackage (packageOne ,
64+ PackageRegistry . Register (packageOne ,
4965 [Shops .Pawn_Shop , Shops .Easy_Depot ,
5066 Shops .Bar , Shops .EZ_Bakery , Shops .Easy_Flowers ]);
5167
5268 // add a package to one shop
53- PackageRegister . RegisterPackage (packageTwo , Shops .Easy_Depot );
69+ PackageRegistry . Register (packageTwo , Shops .Easy_Depot );
5470 }
5571}
5672```
0 commit comments