58 lines
1.9 KiB
Rust
58 lines
1.9 KiB
Rust
//! Cursebreaker Unity Parser
|
|
//!
|
|
//! A high-performance Rust library for parsing Unity project files (.unity scenes,
|
|
//! .prefab prefabs, and .asset ScriptableObjects).
|
|
//!
|
|
//! # Example
|
|
//!
|
|
//! ```no_run
|
|
//! use unity_parser::UnityFile;
|
|
//!
|
|
//! let file = UnityFile::from_path("Scene.unity")?;
|
|
//! match file {
|
|
//! UnityFile::Scene(scene) => {
|
|
//! info!("Scene with {} entities", scene.entity_map.len());
|
|
//! // Access scene.world for ECS queries
|
|
//! }
|
|
//! UnityFile::Prefab(prefab) => {
|
|
//! info!("Prefab with {} documents", prefab.documents.len());
|
|
//! }
|
|
//! UnityFile::Asset(asset) => {
|
|
//! info!("Asset with {} documents", asset.documents.len());
|
|
//! }
|
|
//! }
|
|
//! # Ok::<(), unity_parser::Error>(())
|
|
//! ```
|
|
|
|
// Public modules
|
|
pub mod ecs;
|
|
pub mod error;
|
|
pub mod log;
|
|
pub mod macros;
|
|
pub mod model;
|
|
pub mod parser;
|
|
pub mod post_processing;
|
|
// TODO: Update project module to work with new UnityFile enum architecture
|
|
// pub mod project;
|
|
pub mod property;
|
|
pub mod types;
|
|
|
|
// Re-exports
|
|
pub use error::{Error, Result};
|
|
pub use model::{RawDocument, UnityAsset, UnityFile, UnityPrefab, UnityScene, UnityProject};
|
|
pub use parser::{
|
|
find_project_root, meta::MetaFile, parse_unity_file, parse_unity_file_filtered,
|
|
parse_scene_with_project_filtered, GuidResolver, PrefabGuidResolver,
|
|
};
|
|
pub use post_processing::{compute_world_transforms, WorldTransform};
|
|
pub use property::PropertyValue;
|
|
pub use types::{
|
|
get_class_name, get_type_id, Color, ComponentContext, ComponentRegistration, EcsInsertable,
|
|
ExternalRef, FileID, FileRef, GameObject, Guid, LocalID, PrefabInstance,
|
|
PrefabInstanceComponent, PrefabModification, PrefabResolver, Quaternion, RectTransform,
|
|
Transform, TypeFilter, UnityComponent, UnityReference, Vector2, Vector3, yaml_helpers,
|
|
};
|
|
|
|
// Re-export the derive macro from the macro crate
|
|
pub use unity_parser_macros::UnityComponent;
|