A tool to dump or replace assets in a Unity asset bundle.
This program requires an uncompressed Unity asset bundle. Use Unity Assets Bundle Extractor Avalonia (UABEA) to decompress an asset bundle if it's compressed.
It also requires the name of the member
(the field of an object in the assets file, NOT the game object itself) you'd like interact with in the asset bundle (ex. m_Name
), except for when you are dealing with textures.
The best way to find members/fields for an object is to open the asset bundle in UABEA or a similar tool, then open the asset file and then the object, where you'll find a list of all members for that object.
To extract, you also need to set the path of where you'd like to dump to.
To replace assets, you need to specify the path where the assets to import are and the name of the new asset bundle you're exporting. The files inside of the directory must match the asset names exactly in order to be imported.
For a more in-depth tutorial, check out the guide.
-h
,-?
,--help
: show the help message and then exit.-b
,--bundle=BUNDLE
: the original asset bundle path you want to read from.-m
,--member=MEMBER
: the member to dump or replace.-t
,--texture
: will deal with textures instead of members. Uses PNG the format.
-d
,--dump=DUMP
: the path of the directory you wish to dump the assets to.
-i
,--input=INPUT
: the input directory of the assets you wish to overwrite with.-o
,--output=OUTPUT
: the path and name of the asset bundle you wish to write to when replacing.
- Dump all assets from
assetBundle.bun
with memberm_Script
toextractedAssets/
:UnityAssetReplacer -b assetBundle.bun -m m_Script -d extractedAssets
- Replace assets in
assetBundle.bun
with memberm_Script
, reading fromnewAssets/
, tonewAssetBundle.bun
:UnityAssetReplacer -b assetBundle.bun -m m_Script -i newAssets -o newAssetBundle.bun
- Dump all textures from
assetBundle.bun
toextractedTextures/
:UnityAssetReplacer -b assetBundle.bun -t -d extractedTextures
- Replace textures in
assetBundle.bun
, reading fromnewTextures/
, tonewAssetBundle.bun
:UnityAssetReplacer -b assetBundle.bun -t -i newTextures -o newAssetBundle.bun
See the guide for how it is used in action.
- .NET 5
- Visual Studio 2019 (Optional)
- Restore any packages with
dotnet restore
or skip and let it run implicitly when running the next step. - Run
dotnet build
in the project root.
- Open
UnityAssetReplacer.sln
in Visual Studio - Press
Build -> Build Solution
to build or the green arrow to build and run.
- AssetTools.NET: The library used to extract assets from Unity asset bundles.
- Unity Assets Bundle Extractor Avalonia (UABEA): A program that runs on AssetTools.NET. Useful for seeing how to use the library.