Packaging asset bundles
Once your assets are ready, follow these steps to package them with your mod.
Mods are published in a directory matching the mod's id, in our case ExampleMod/.
Now we can add asset bundles to the same directory.
- Ensure that everything in Unity is saved (use
Ctrl+S). - Build asset bundles by right-clicking anywhere in the project pane (on any file or empty area) and select
[MaFi] Build asset bundles. After Unity is done processing, asset bundle files can be found in thesrc/ExampleMod.Unity/AssetBundlesdirectory. - Asset bundles are automatically copied to the mod deployment folder on the next build (see Automatic deployment). You can also manually copy contents of
src/ExampleMod.Unity/AssetBundlesto theAssetBundlesfolder next to the mod DLL. - (optional) If you want to make it neat, you really only need the asset bundles (files in format
YourPrefabName_xxxx, without extension) and themafi_bundles.manifestfile. All other.manifestfiles could be removed as well as theAssetBundlesfile.
If you make any changes to your prefabs, simply rebuild asset bundles and use the new files from the AssetBundles directory.