From 20c8d3f92a02c818300217e2a34f6debe9bd1b1c Mon Sep 17 00:00:00 2001 From: Raphtalia Date: Fri, 26 Jul 2024 05:37:36 +0000 Subject: [PATCH] Update Setup --- Setup.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Setup.md b/Setup.md index cf5a406..8e8a53d 100644 --- a/Setup.md +++ b/Setup.md @@ -1,7 +1,25 @@ -### How to add the DungeonGenerationPlus mod to your interior Unity project +### Setting up the plugin in your Unity project Download the `DunGenPlus.dll` through Thunderstore or through this Github repository. Drag and drop the `.dll` file into your interior Unity project. This mod also requires the LethalLevelLoader plugin to be installed in your Unity project. With just those simple steps, the mod is installed. You can now setup and use this mod's features. This goes without saying, this mod also requires the DungeonGenerationPlus mod to be installed in your Lethal Company mod pack. -If you'd like to use this mod's API and callback features, reference the same `DunGenPlus.dll` file in your code project thing what do you call that? \ No newline at end of file +If you'd like to use this mod's API and callback features, reference the same `DunGenPlus.dll` file in your code project thing what do you call that? + +### Setting up the DunGenExtender asset + +Inside the Project tab, right click to open the Assets tab. Select `Create/DunGenExtender` to create the `DunGenExtender` asset. Inside that asset, reference the `DungeonFlow` that will be linked to this Extender asset. Finally, set it's AssetBundle name to the same one as your interior's asset, `DungeonFlow` or `ExtendedDungeonFlow` whichever it may be. + +If you are creating a `.lethalbundle` asset to be automatically handled by LethalLevelLoader, then that's it. The DungeonGenerationPlus mod will automatically extract and read the `DunGenExtender` asset from the `.lethalbundle` asset when the game runs. + +If you are loading the asset manually, you must register the 'DunGenExtender' asset manually through the API. The following is a code example of how you may want to do it. +```cs +var dungeon = YOUR_ASSET_BUNDLE.LoadAsset("YOUR_DUNGEONFLOW_ASSET_NAME"); +var extender = YOUR_ASSET_BUNDLE.LoadAsset("YOUR_EXTENDER_ASSET_NAME"); +DunGenPlus.API.AddDunGenExtender(dungeon, extender); +``` +After any of the two previous steps, verify that the Extender was registered by finding this message in the logs. + +### Setting up the API Callbacks + +Inside the Project tab, right click to open the Assets tab. Select `Create/DunGenExtender` to create the `DunGenExtender` asset. Inside that asset, reference the `DungeonFlow` that will be linked to this Extender asset. Finally, set it's AssetBundle name to the same one as your interior's asset, `DungeonFlow` or `ExtendedDungeonFlow` whichever it may be. If it's I'm not sure if the extension must be `.lethalbundle` or if Unity automatically fixes it; either way set the extension as `.lethalbundle` to be safe. \ No newline at end of file