EtG Modding Guide
  • ETG Modding Guide
  • Getting started
    • Modding EtG: Installing Mods
    • Modding EtG: Creating a Mod
    • Uploading a Mod
    • Useful Tools
      • Using IlSpy
  • Making An Item
    • Creating A Passive
    • Creating An Active
    • Creating An Ammolet
    • Creating A Guon
    • Synergies
  • Making a Gun
    • Creating A Gun
      • Setting Up Gun Sprite Folders
      • Creating Gun Jsons/Jtk2ds
        • Pixel Measurement Conversions
    • Setting Up Projectiles
      • Adding Components To A Projectile
      • Projectile HitEffects (Visual Effects)
      • Adding status effects to a projectile
    • Continuous Fire Animations
    • Gun Ammo Types
  • Custom Characters
    • Creating A Standalone Custom Character
  • Making a Floor
    • Introduction
    • Setup
    • Making The Dungeon
    • Tileset
    • Rooms
    • Making the flow
    • Making the Entrance
    • All Files
  • Text, Text Boxes, Etc
    • Textboxes
    • Text Formatting
  • Sounds
    • Using Custom Sounds
    • Customising Gun Sounds
    • Basegame Sound List
    • wwise Sound Dump
  • Misc
    • Making Asset bundles
    • Assetbundles: How-To
    • How to create a hook
    • Creating A Command
    • Subscribing Methods to Actions
    • Reversing Player Controls
    • Undodgeable Projectiles
    • Creating An Enemy
  • Shaders
    • Creating Shaders
  • All things Spriting
    • Important Sprite Creation Information.
    • Importing a Sprite To Visual Studios
  • Monobehaviour Documentation
    • BounceProjModifier
    • PierceProjModifier
    • KeyProjModifier
    • CompanionFollowPlayerBehaviour
  • Various Lists of IDs, Sounds, Etc.
    • List of Item and Gun IDs
    • Enemy Guids
    • List of Base Game Synergies
    • dfSpriteList
    • All Custom Ammo Types
    • Gun .Json Dump
  • OFF TOPIC MEMES
    • Modders Anthem
Powered by GitBook
On this page
  • Difficulty: 5/10
  • Creating Asset Bundles
  • Loading the AssetBundle
  • Loading objects from the AssetBundle

Was this helpful?

  1. Misc

Making Asset bundles

Previouswwise Sound DumpNextAssetbundles: How-To

Last updated 3 years ago

Was this helpful?

Difficulty: 5/10

Making asset bundles are a way to use real prefabs in gungeon.

Creating Asset Bundles

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:

using UnityEngine;
using UnityEditor;
using System.IO;
using UnityEngine.UI;

public class CreateAssetBundles
{
    [MenuItem("Assets/Build AssetBundles")]
    static void BuildAllAssetBundles()
    {
        string assetBundleDirectory = "Assets/StreamingAssets";
        if (!Directory.Exists(Application.streamingAssetsPath))
        {
            Directory.CreateDirectory(assetBundleDirectory);
        }
        BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, EditorUserBuildSettings.activeBuildTarget);
    }
}

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.

Loading the AssetBundle

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");

Loading objects from the AssetBundle

to load an object use ModAssets.LoadAsset<ObjectType>("object name");

for example, if it's a gameObject use

ModAssets.LoadAsset<GameObject>("object name");

Get Unity - Download Archive - UnityUnity
Logo
2KB
AssetBundleLoader.cs