-
-
Notifications
You must be signed in to change notification settings - Fork 55
How to create and use Asset Bundles
piotrulos edited this page Mar 15, 2023
·
8 revisions
Asset bundles allow you to import unity prefabs into you mods, this will save you some time for more complex objects.
This tutorial is only how to create and import asset bundles, if you want some tutorial for unity engine itself, this is not place for you.
Best way to start with unity is official documentation (click here for version 5.0)
- Unity 5.0.0f4 (32-bit) or (64-bit) (current unity used in game, kinda old but still can download from archive, go to unity 5.x and scroll all way to bottom) Direct Link
- Prepared project for unity with assetbundle script
- Install unity
- Open prepared project you downloaded in previous step.
- Create some prefab (with everything you need, complex objects, animations, etc.)
- Select created prefab, and on bottom left you should have AssetBundle
- Click on first
None
and selectNew...
- Name it for example
something.unity3d
and press enter
- Add more things (prefabs,textures,sounds) that you need by just selecting "None" and then name of your bundle
something.unity3d
- If you are done, press anywhere right mouse button, or from top menu select
Assets
and clickBuild AssetBundles
- Wait to finish, and go to your project root folder (you can go there by
right click>Show in explorer
)
- Go to folder called
AssetBundles
and grab your filesomething.unity3d
this is file you only need (ignore other files)
- Copy this file to your mods Assets folder and import it in code
AssetBundle ab = LoadAssets.LoadBundle(this,"something.unity3d");
GameObject go = ab.LoadAsset<GameObject>("test.prefab");
//REMEMBER to instantiate your object next.
ab.Unload(false); //unload when you take all items you need.
- How to install MSCLoader using MSCPatcher
- MSCPatcher explained
- How to install mods
- Official experimental linux support
- Unofficial tutorial for linux (wine/proton)
- Install Visual Studio for MSCLoader
- Install template for Visual Studio
- How to use templates
- Debugging your mods in Visual Studio
- Enable DevMode to help with debugging
- Uploading and creating Self update feature for your mod or reference
- All Playmaker Global Variables and Events
- How to create and use Asset Bundles