Skip to content

Trying to read asset bundle #136

@gonsodany

Description

@gonsodany

Im trying to modify an asset bundle, what im trying to do is modify some parameters on an animator controller of the asset bundle, i've been trying for 2 days to so much as read the asset bundle but nothing on the examples/documentation works

using the "Read Asset bundles" example but the code doesnt work

"var manager = new AssetsManager();

// Load the bundle file
var bunInst = manager.LoadBundleFile(assetURL, true);
foreach (var asset in bunInst.file.GetAllFileNames())
{

}
var afileInst = manager.LoadAssetsFileFromBundle(bunInst, 0, false);
var afile = afileInst.file;

// Loop through the textures and log their names and dimensions
foreach (var texInfo in afile.GetAssetsOfType(AssetClassID.Texture2D))
{
var texBase = manager.GetBaseField(afileInst, texInfo);
var name = texBase["m_Name"].AsString;
var width = texBase["m_Width"].AsInt;
var height = texBase["m_Height"].AsInt;

Debug.Log($"Texture {name} is sized {width}x{height}");

}"

image
image
image
these methods dont exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions