unity-asset-binary 0.1.0

Unity binary file format parser (AssetBundle, SerializedFile)
Documentation

Unity Binary Asset Parser

This crate provides functionality to parse Unity binary file formats including:

  • AssetBundle files (.bundle, .unity3d)
  • Serialized Asset files (.assets)
  • Resource files

Features

  • AssetBundle parsing: Support for UnityFS format
  • Compression support: LZ4, LZMA, and other compression formats
  • TypeTree parsing: Dynamic type information for objects
  • Object extraction: Extract Unity objects from binary data

Feature Flags

  • texture: Texture processing (basic formats + PNG export)
  • audio: Audio processing (all formats including Vorbis, MP3)
  • mesh: Mesh processing (parsing + basic export)
  • sprite: Sprite processing (requires texture support)
  • texture-advanced: Advanced texture formats (DXT, ETC, ASTC) - requires texture2ddecoder
  • mesh-export: Advanced mesh export (OBJ format)

Example

use unity_asset_binary::load_bundle_from_memory;
use std::fs;

// Load an AssetBundle file
let data = fs::read("example.bundle")?;
let bundle = load_bundle_from_memory(data)?;

// Access contained assets
for asset in &bundle.assets {
    println!("Asset with {} objects", asset.object_count());
    // Access objects in the asset
    for object in &asset.objects {
        println!("  Object: {} (type_id: {})", object.path_id, object.type_id);
    }
}
# Ok::<(), Box<dyn std::error::Error>>(())