| Crates.io | unity-asset |
| lib.rs | unity-asset |
| version | 0.1.0 |
| created_at | 2025-08-27 16:21:58.714004+00 |
| updated_at | 2025-08-27 16:21:58.714004+00 |
| description | A comprehensive Rust library for parsing Unity asset files (YAML and binary formats) |
| homepage | |
| repository | https://github.com/Latias94/unity-asset |
| max_upload_size | |
| id | 1812896 |
| size | 72,686 |
A Rust implementation of Unity asset parsing, inspired by and learning from UnityPy. This project focuses on parsing Unity YAML and binary formats with Rust's memory safety and performance characteristics.
⚠️ Early Development: This is a learning project and reference implementation. It is not production-ready and has significant limitations compared to mature tools like UnityPy.
The project uses a workspace structure to organize different parsing capabilities:
unity-asset/
├── unity-asset-core/ # Core data structures and traits
├── unity-asset-yaml/ # YAML file parsing (complete)
├── unity-asset-binary/ # Binary asset parsing (complete)
├── unity-asset-lib/ # Main library crate (published as `unity-asset`)
├── unity-asset-cli/ # CLI tools
│ ├── main.rs # Synchronous CLI tool
│ └── main_async.rs # Asynchronous CLI tool (--features async)
├── examples/ # Usage examples and demos
└── tests/ # Integration tests and sample files
⚠️ Known Limitations
texture-advanced feature (DXT, ETC, ASTC)audio feature for Symphonia integrationNote: This project will be published to crates.io soon. For now, to try it out:
# Clone and build from source
git clone https://github.com/Latias94/unity-asset.git
cd unity-asset
# Build the library
cargo build --all
# Try the CLI tools
cargo run --bin unity-asset -- --help
cargo run --features async --bin unity-asset-async -- --help
Once published, you'll be able to install it with:
# Add to your Cargo.toml
[dependencies]
unity-asset = "0.1.0"
# Install CLI tools
cargo install unity-asset-cli
We have basic tests for core functionality, but this is not a comprehensive test suite. Some tests pass, others reveal limitations in our implementation.
UnityPy is a mature, feature-complete Python library for Unity asset manipulation. This Rust project is:
If you need a production tool for Unity asset processing, use UnityPy instead.
use unity_asset::{YamlDocument, UnityDocument};
// Load a Unity YAML file
let doc = YamlDocument::load_yaml("ProjectSettings.asset", false)?;
// Get basic information
println!("Found {} entries", doc.entries().len());
// Try to find specific objects (may not work for all files)
if let Ok(settings) = doc.get(Some("PlayerSettings"), None) {
println!("Found PlayerSettings");
}
# Parse a single YAML file
cargo run --bin unity-asset -- parse-yaml -i ProjectSettings.asset
# Try async processing (experimental)
cargo run --features async --bin unity-asset-async -- \
parse-yaml -i Assets/ --recursive --progress
This project is organized as a Rust workspace with separate crates for different concerns:
unity-asset-core: Core data structures and traitsunity-asset-yaml: YAML format parsingunity-asset-binary: Binary format parsing (AssetBundle, SerializedFile)unity-asset-lib: Main library crate (published as unity-asset)unity-asset-cli: Command-line tools (published as unity-asset-cli)This project is a learning exercise inspired by and learning from several excellent projects:
This project is licensed under the MIT License - see the LICENSE file for details.