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.

  1. Ensure that everything in Unity is saved (use Ctrl+S).
  2. 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 the src/ExampleMod.Unity/AssetBundles directory.
  3. 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/AssetBundles to the AssetBundles folder next to the mod DLL.
  4. (optional) If you want to make it neat, you really only need the asset bundles (files in format YourPrefabName_xxxx, without extension) and the mafi_bundles.manifest file. All other .manifest files could be removed as well as the AssetBundles file.

If you make any changes to your prefabs, simply rebuild asset bundles and use the new files from the AssetBundles directory.