Making Asset bundles
Last updated
Last updated
Making asset bundles are a way to use real prefabs in gungeon.
You need to download unity and download version 2017.4.40 so that the asset bundles you make are compatible with gungeon.
They can be located here:
Create a new folder called Editor:
And inside the floder create a c# script and call It CreateAssetBundles. To do this right click and select create>C# script
Now open the script and paste this code in:
Go back to the assets folder and create a new folder called BundledAssets, this will contain all the gameobjects, textures, etc. select the object you want to be part of the asset bundle and go to the bottom of the inspector panel
create a new assetbundle
and then any object you want in the assetbundle will go under the one you made.
click the assets tab at the top left and go to the bottom where it says build assetbundles.
in your mod drop this file in.
in your module add
public static AssetBundle ModAssets;
before you load anything from this asset bundle do
ModAssets = AssetBundleLoader.LoadAssetBundleFromLiterallyAnywhere("assetbundlename");
to load an object use
ModAssets.LoadAsset<ObjectType>("object name");
for example, if it's a gameObject use
ModAssets.LoadAsset<GameObject>("object name");