diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 8bb3dad..393fe40 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -11,7 +11,8 @@ "Bash(cargo check:*)", "Bash(ls:*)", "Bash(find:*)", - "Bash(grep:*)" + "Bash(grep:*)", + "Bash(wc:*)" ], "additionalDirectories": [ "/home/connor/repos/CBAssets/" diff --git a/Cargo.lock b/Cargo.lock index 26d0a3a..a04b159 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,34 +23,6 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41e67cd8309bbd06cd603a9e693a784ac2e5d1e955f11286e355089fcab3047c" -[[package]] -name = "cursebreaker-parser" -version = "0.1.0" -dependencies = [ - "cursebreaker-parser-macros", - "glam", - "indexmap", - "inventory", - "lru", - "once_cell", - "pretty_assertions", - "regex", - "serde", - "serde_yaml", - "sparsey", - "thiserror", - "walkdir", -] - -[[package]] -name = "cursebreaker-parser-macros" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "diff" version = "0.1.13" @@ -318,6 +290,34 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" +[[package]] +name = "unity-parser" +version = "0.1.0" +dependencies = [ + "glam", + "indexmap", + "inventory", + "lru", + "once_cell", + "pretty_assertions", + "regex", + "serde", + "serde_yaml", + "sparsey", + "thiserror", + "unity-parser-macros", + "walkdir", +] + +[[package]] +name = "unity-parser-macros" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "unsafe-libyaml" version = "0.2.11" diff --git a/Cargo.toml b/Cargo.toml index 14ba694..b3e3797 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["cursebreaker-parser", "cursebreaker-parser-macros"] +members = ["unity-parser", "unity-parser-macros"] resolver = "2" [workspace.package] @@ -7,4 +7,4 @@ version = "0.1.0" edition = "2021" authors = ["Your Name "] license = "MIT OR Apache-2.0" -repository = "https://github.com/yourusername/cursebreaker-parser-rust" +repository = "https://github.com/yourusername/unity-parser-rust" diff --git a/README.md b/README.md index 1f63cd8..27fa34e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Cursebreaker Parser +# Unity Parser A high-performance Rust library for parsing Unity project files (.unity scenes, .prefab prefabs, and .asset ScriptableObjects) with automatic MonoBehaviour component discovery and ECS integration. @@ -32,7 +32,7 @@ Add to your `Cargo.toml`: ```toml [dependencies] -cursebreaker-parser = "0.1" +unity-parser = "0.1" sparsey = "0.13" # For ECS queries ``` @@ -41,7 +41,7 @@ sparsey = "0.13" # For ECS queries ### Parse a Unity Scene ```rust -use cursebreaker_parser::UnityFile; +use unity_parser::UnityFile; fn main() -> Result<(), Box> { let file = UnityFile::from_path("Scene.unity")?; @@ -51,7 +51,7 @@ fn main() -> Result<(), Box> { println!("Scene with {} entities", scene.entity_map.len()); // Query transforms - let transforms = scene.world.borrow::(); + let transforms = scene.world.borrow::(); for (file_id, entity) in &scene.entity_map { if let Some(transform) = transforms.get(*entity) { println!("Entity {} at {:?}", file_id, transform.local_position()); @@ -73,7 +73,7 @@ fn main() -> Result<(), Box> { ### Define Custom Components ```rust -use cursebreaker_parser::UnityComponent; +use unity_parser::UnityComponent; #[derive(Debug, Clone, UnityComponent)] #[unity_class("PlaySFX")] @@ -133,7 +133,7 @@ Parse only scenes matching specific patterns: ```rust use regex::Regex; -use cursebreaker_parser::parse_unity_file_filtered; +use unity_parser::parse_unity_file_filtered; // Only parse production scenes let filter = Regex::new(r"Assets/Scenes/Production/")?; @@ -161,7 +161,7 @@ let filter = Regex::new(r"Level[1-5]\.unity$")?; Selectively parse components for better performance: ```rust -use cursebreaker_parser::{TypeFilter, parse_with_types}; +use unity_parser::{TypeFilter, parse_with_types}; // Parse only transforms and custom components let filter = TypeFilter::parse_with_types(&["Transform", "PlaySFX"]); @@ -232,7 +232,7 @@ Raw YAML Documents ### Find All Components of a Type ```rust -use cursebreaker_parser::UnityFile; +use unity_parser::UnityFile; let scene = UnityFile::from_path("Scene.unity")?; @@ -378,7 +378,7 @@ Benchmarks on VR Horror project (21 scenes, 77 C# scripts): ## Project Structure ``` -cursebreaker-parser/ +unity-parser/ ├── src/ │ ├── ecs/ # ECS world building │ ├── model/ # UnityFile, Scene, Prefab models @@ -387,11 +387,15 @@ cursebreaker-parser/ │ │ ├── meta.rs # .meta file parsing │ │ └── yaml.rs # YAML document splitting │ ├── types/ # Unity types and components +│ │ ├── unity_types/ # Unity-specific types +│ │ │ ├── game_object.rs +│ │ │ ├── prefab_instance.rs +│ │ │ └── transform.rs │ │ ├── guid.rs # 128-bit GUID type │ │ ├── component.rs # Component trait system │ │ └── ... │ └── lib.rs -├── cursebreaker-parser-macros/ # Derive macro crate +├── unity-parser-macros/ # Derive macro crate ├── examples/ # Usage examples ├── tests/ # Integration tests └── test_data/ # Test Unity projects diff --git a/cursebreaker-parser-macros/Cargo.toml b/unity-parser-macros/Cargo.toml similarity index 61% rename from cursebreaker-parser-macros/Cargo.toml rename to unity-parser-macros/Cargo.toml index d602c0f..4818095 100644 --- a/cursebreaker-parser-macros/Cargo.toml +++ b/unity-parser-macros/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "cursebreaker-parser-macros" +name = "unity-parser-macros" version = "0.1.0" edition = "2021" authors = ["Your Name "] license = "MIT OR Apache-2.0" -description = "Procedural macros for cursebreaker-parser" -repository = "https://github.com/yourusername/cursebreaker-parser-rust" +description = "Procedural macros for unity-parser" +repository = "https://github.com/yourusername/unity-parser-rust" [lib] proc-macro = true diff --git a/cursebreaker-parser-macros/src/lib.rs b/unity-parser-macros/src/lib.rs similarity index 99% rename from cursebreaker-parser-macros/src/lib.rs rename to unity-parser-macros/src/lib.rs index e3fc602..a006e76 100644 --- a/cursebreaker-parser-macros/src/lib.rs +++ b/unity-parser-macros/src/lib.rs @@ -1,4 +1,4 @@ -//! Procedural macros for cursebreaker-parser +//! Procedural macros for unity-parser //! //! This crate provides the `#[derive(UnityComponent)]` macro for automatically //! generating Unity component parsing code. diff --git a/cursebreaker-parser/Cargo.toml b/unity-parser/Cargo.toml similarity index 85% rename from cursebreaker-parser/Cargo.toml rename to unity-parser/Cargo.toml index c89f1d6..93647d4 100644 --- a/cursebreaker-parser/Cargo.toml +++ b/unity-parser/Cargo.toml @@ -1,17 +1,17 @@ [package] -name = "cursebreaker-parser" +name = "unity-parser" version = "0.1.0" edition = "2021" authors = ["Your Name "] license = "MIT OR Apache-2.0" description = "A high-performance Rust library for parsing Unity project files (.unity, .prefab, .asset)" -repository = "https://github.com/yourusername/cursebreaker-parser-rust" +repository = "https://github.com/yourusername/unity-parser-rust" keywords = ["unity", "parser", "yaml", "gamedev"] categories = ["parser-implementations", "game-development"] rust-version = "1.70" [lib] -name = "cursebreaker_parser" +name = "unity_parser" path = "src/lib.rs" [dependencies] @@ -47,7 +47,7 @@ once_cell = "1.19" inventory = "0.3" # Procedural macro for derive(UnityComponent) -cursebreaker-parser-macros = { path = "../cursebreaker-parser-macros" } +unity-parser-macros = { path = "../unity-parser-macros" } [dev-dependencies] # Testing utilities diff --git a/cursebreaker-parser/examples/basic_parsing.rs b/unity-parser/examples/basic_parsing.rs similarity index 98% rename from cursebreaker-parser/examples/basic_parsing.rs rename to unity-parser/examples/basic_parsing.rs index 4cbf88f..de310e2 100644 --- a/cursebreaker-parser/examples/basic_parsing.rs +++ b/unity-parser/examples/basic_parsing.rs @@ -1,4 +1,4 @@ -use cursebreaker_parser::UnityFile; +use unity_parser::UnityFile; use std::path::Path; fn main() { diff --git a/cursebreaker-parser/examples/custom_component.rs b/unity-parser/examples/custom_component.rs similarity index 95% rename from cursebreaker-parser/examples/custom_component.rs rename to unity-parser/examples/custom_component.rs index 1dc3d3d..820edde 100644 --- a/cursebreaker-parser/examples/custom_component.rs +++ b/unity-parser/examples/custom_component.rs @@ -1,7 +1,7 @@ //! Example demonstrating how to define custom Unity MonoBehaviour components //! using the #[derive(UnityComponent)] macro. -use cursebreaker_parser::{yaml_helpers, ComponentContext, UnityComponent}; +use unity_parser::{yaml_helpers, ComponentContext, UnityComponent}; /// Custom Unity MonoBehaviour component for playing sound effects /// @@ -71,7 +71,7 @@ isLoop: 1 let mapping = yaml.as_mapping().unwrap(); // Create a dummy context - use cursebreaker_parser::{ComponentContext, FileID}; + use unity_parser::{ComponentContext, FileID}; let ctx = ComponentContext { type_id: 114, file_id: FileID::from_i64(12345), diff --git a/cursebreaker-parser/examples/ecs_integration.rs b/unity-parser/examples/ecs_integration.rs similarity index 97% rename from cursebreaker-parser/examples/ecs_integration.rs rename to unity-parser/examples/ecs_integration.rs index 6bc7d5c..0dc49ef 100644 --- a/cursebreaker-parser/examples/ecs_integration.rs +++ b/unity-parser/examples/ecs_integration.rs @@ -5,7 +5,7 @@ //! 2. Using the parse_with_types! macro for selective parsing //! 3. Querying the ECS world for components -use cursebreaker_parser::{parse_with_types, ComponentContext, EcsInsertable, FileID, TypeFilter, UnityComponent}; +use unity_parser::{parse_with_types, ComponentContext, EcsInsertable, FileID, TypeFilter, UnityComponent}; /// Custom Unity MonoBehaviour component #[derive(Debug, Clone, UnityComponent)] diff --git a/cursebreaker-parser/examples/find_playsfx.rs b/unity-parser/examples/find_playsfx.rs similarity index 95% rename from cursebreaker-parser/examples/find_playsfx.rs rename to unity-parser/examples/find_playsfx.rs index ee48951..18a83f3 100644 --- a/cursebreaker-parser/examples/find_playsfx.rs +++ b/unity-parser/examples/find_playsfx.rs @@ -6,7 +6,7 @@ //! 3. Querying the ECS world for components //! 4. Accessing Transform data for component locations -use cursebreaker_parser::{UnityComponent, UnityFile}; +use unity_parser::{UnityComponent, UnityFile}; use std::path::Path; /// PlaySFX component from VR_Horror_YouCantRun @@ -71,9 +71,9 @@ fn main() -> Result<(), Box> { Ok(UnityFile::Scene(scene)) => { // Get views for all component types we need let playsfx_view = scene.world.borrow::(); - let transform_view = scene.world.borrow::(); - let rect_transform_view = scene.world.borrow::(); - let gameobject_view = scene.world.borrow::(); + let transform_view = scene.world.borrow::(); + let rect_transform_view = scene.world.borrow::(); + let gameobject_view = scene.world.borrow::(); // Find all entities that have PlaySFX let mut found_count = 0; diff --git a/cursebreaker-parser/examples/guid_resolution.rs.disabled b/unity-parser/examples/guid_resolution.rs.disabled similarity index 100% rename from cursebreaker-parser/examples/guid_resolution.rs.disabled rename to unity-parser/examples/guid_resolution.rs.disabled diff --git a/cursebreaker-parser/examples/parse_resource_prefabs.rs b/unity-parser/examples/parse_resource_prefabs.rs similarity index 99% rename from cursebreaker-parser/examples/parse_resource_prefabs.rs rename to unity-parser/examples/parse_resource_prefabs.rs index e6aa55a..9753b8a 100644 --- a/cursebreaker-parser/examples/parse_resource_prefabs.rs +++ b/unity-parser/examples/parse_resource_prefabs.rs @@ -10,7 +10,7 @@ //! doesn't yet support resolving components from nested prefabs. This example //! parses the prefab files directly instead. -use cursebreaker_parser::{GuidResolver, UnityComponent, UnityFile}; +use unity_parser::{GuidResolver, UnityComponent, UnityFile}; use std::fs::File; use std::io::Write; use std::path::Path; diff --git a/cursebreaker-parser/examples/parse_resources.rs b/unity-parser/examples/parse_resources.rs similarity index 95% rename from cursebreaker-parser/examples/parse_resources.rs rename to unity-parser/examples/parse_resources.rs index 952912b..c2a186c 100644 --- a/cursebreaker-parser/examples/parse_resources.rs +++ b/unity-parser/examples/parse_resources.rs @@ -6,7 +6,7 @@ //! 3. Extracting typeId and transform positions //! 4. Writing resource data to an output file -use cursebreaker_parser::{UnityComponent, UnityFile}; +use unity_parser::{UnityComponent, UnityFile}; use std::fs::File; use std::io::Write; use std::path::Path; @@ -58,8 +58,8 @@ fn main() -> Result<(), Box> { // Get views for component types we need let resource_view = scene.world.borrow::(); - let transform_view = scene.world.borrow::(); - let gameobject_view = scene.world.borrow::(); + let transform_view = scene.world.borrow::(); + let gameobject_view = scene.world.borrow::(); // Find all entities that have Interactable_Resource let mut found_resources = Vec::new(); diff --git a/cursebreaker-parser/resources_output.txt b/unity-parser/resources_output.txt similarity index 100% rename from cursebreaker-parser/resources_output.txt rename to unity-parser/resources_output.txt diff --git a/cursebreaker-parser/src/ecs/builder.rs b/unity-parser/src/ecs/builder.rs similarity index 100% rename from cursebreaker-parser/src/ecs/builder.rs rename to unity-parser/src/ecs/builder.rs diff --git a/cursebreaker-parser/src/ecs/mod.rs b/unity-parser/src/ecs/mod.rs similarity index 100% rename from cursebreaker-parser/src/ecs/mod.rs rename to unity-parser/src/ecs/mod.rs diff --git a/cursebreaker-parser/src/error.rs b/unity-parser/src/error.rs similarity index 100% rename from cursebreaker-parser/src/error.rs rename to unity-parser/src/error.rs diff --git a/cursebreaker-parser/src/lib.rs b/unity-parser/src/lib.rs similarity index 92% rename from cursebreaker-parser/src/lib.rs rename to unity-parser/src/lib.rs index d8cd94f..1bd960d 100644 --- a/cursebreaker-parser/src/lib.rs +++ b/unity-parser/src/lib.rs @@ -6,7 +6,7 @@ //! # Example //! //! ```no_run -//! use cursebreaker_parser::UnityFile; +//! use unity_parser::UnityFile; //! //! let file = UnityFile::from_path("Scene.unity")?; //! match file { @@ -21,7 +21,7 @@ //! println!("Asset with {} documents", asset.documents.len()); //! } //! } -//! # Ok::<(), cursebreaker_parser::Error>(()) +//! # Ok::<(), unity_parser::Error>(()) //! ``` // Public modules @@ -53,4 +53,4 @@ pub use types::{ }; // Re-export the derive macro from the macro crate -pub use cursebreaker_parser_macros::UnityComponent; +pub use unity_parser_macros::UnityComponent; diff --git a/cursebreaker-parser/src/macros.rs b/unity-parser/src/macros.rs similarity index 100% rename from cursebreaker-parser/src/macros.rs rename to unity-parser/src/macros.rs diff --git a/cursebreaker-parser/src/model/mod.rs b/unity-parser/src/model/mod.rs similarity index 100% rename from cursebreaker-parser/src/model/mod.rs rename to unity-parser/src/model/mod.rs diff --git a/cursebreaker-parser/src/parser/guid_resolver.rs b/unity-parser/src/parser/guid_resolver.rs similarity index 100% rename from cursebreaker-parser/src/parser/guid_resolver.rs rename to unity-parser/src/parser/guid_resolver.rs diff --git a/cursebreaker-parser/src/parser/meta.rs b/unity-parser/src/parser/meta.rs similarity index 100% rename from cursebreaker-parser/src/parser/meta.rs rename to unity-parser/src/parser/meta.rs diff --git a/cursebreaker-parser/src/parser/mod.rs b/unity-parser/src/parser/mod.rs similarity index 100% rename from cursebreaker-parser/src/parser/mod.rs rename to unity-parser/src/parser/mod.rs diff --git a/cursebreaker-parser/src/parser/prefab_guid_resolver.rs b/unity-parser/src/parser/prefab_guid_resolver.rs similarity index 100% rename from cursebreaker-parser/src/parser/prefab_guid_resolver.rs rename to unity-parser/src/parser/prefab_guid_resolver.rs diff --git a/cursebreaker-parser/src/parser/unity_tag.rs b/unity-parser/src/parser/unity_tag.rs similarity index 100% rename from cursebreaker-parser/src/parser/unity_tag.rs rename to unity-parser/src/parser/unity_tag.rs diff --git a/cursebreaker-parser/src/parser/yaml.rs b/unity-parser/src/parser/yaml.rs similarity index 100% rename from cursebreaker-parser/src/parser/yaml.rs rename to unity-parser/src/parser/yaml.rs diff --git a/cursebreaker-parser/src/project/mod.rs b/unity-parser/src/project/mod.rs similarity index 100% rename from cursebreaker-parser/src/project/mod.rs rename to unity-parser/src/project/mod.rs diff --git a/cursebreaker-parser/src/project/query.rs b/unity-parser/src/project/query.rs similarity index 100% rename from cursebreaker-parser/src/project/query.rs rename to unity-parser/src/project/query.rs diff --git a/cursebreaker-parser/src/property/mod.rs b/unity-parser/src/property/mod.rs similarity index 100% rename from cursebreaker-parser/src/property/mod.rs rename to unity-parser/src/property/mod.rs diff --git a/cursebreaker-parser/src/types/component.rs b/unity-parser/src/types/component.rs similarity index 100% rename from cursebreaker-parser/src/types/component.rs rename to unity-parser/src/types/component.rs diff --git a/cursebreaker-parser/src/types/guid.rs b/unity-parser/src/types/guid.rs similarity index 100% rename from cursebreaker-parser/src/types/guid.rs rename to unity-parser/src/types/guid.rs diff --git a/cursebreaker-parser/src/types/ids.rs b/unity-parser/src/types/ids.rs similarity index 100% rename from cursebreaker-parser/src/types/ids.rs rename to unity-parser/src/types/ids.rs diff --git a/cursebreaker-parser/src/types/mod.rs b/unity-parser/src/types/mod.rs similarity index 75% rename from cursebreaker-parser/src/types/mod.rs rename to unity-parser/src/types/mod.rs index 393fbf9..e9cd4b8 100644 --- a/cursebreaker-parser/src/types/mod.rs +++ b/unity-parser/src/types/mod.rs @@ -5,28 +5,25 @@ //! wrappers for GameObjects and Components. mod component; -mod game_object; mod guid; mod ids; -mod prefab_instance; mod reference; -mod transform; mod type_filter; mod type_registry; +mod unity_types; mod values; pub use component::{ yaml_helpers, ComponentContext, ComponentRegistration, EcsInsertable, LinkCallback, LinkingContext, UnityComponent, }; -pub use game_object::GameObject; pub use guid::Guid; pub use ids::{FileID, LocalID}; -pub use prefab_instance::{ - PrefabInstance, PrefabInstanceComponent, PrefabModification, PrefabResolver, -}; pub use reference::UnityReference; -pub use transform::{RectTransform, Transform}; pub use type_filter::TypeFilter; pub use type_registry::{get_class_name, get_type_id}; +pub use unity_types::{ + GameObject, PrefabInstance, PrefabInstanceComponent, PrefabModification, PrefabResolver, + RectTransform, Transform, +}; pub use values::{Color, ExternalRef, FileRef, Quaternion, Vector2, Vector3}; diff --git a/cursebreaker-parser/src/types/reference.rs b/unity-parser/src/types/reference.rs similarity index 100% rename from cursebreaker-parser/src/types/reference.rs rename to unity-parser/src/types/reference.rs diff --git a/cursebreaker-parser/src/types/type_filter.rs b/unity-parser/src/types/type_filter.rs similarity index 100% rename from cursebreaker-parser/src/types/type_filter.rs rename to unity-parser/src/types/type_filter.rs diff --git a/cursebreaker-parser/src/types/type_registry.rs b/unity-parser/src/types/type_registry.rs similarity index 100% rename from cursebreaker-parser/src/types/type_registry.rs rename to unity-parser/src/types/type_registry.rs diff --git a/cursebreaker-parser/src/types/game_object.rs b/unity-parser/src/types/unity_types/game_object.rs similarity index 100% rename from cursebreaker-parser/src/types/game_object.rs rename to unity-parser/src/types/unity_types/game_object.rs diff --git a/unity-parser/src/types/unity_types/mod.rs b/unity-parser/src/types/unity_types/mod.rs new file mode 100644 index 0000000..b91e528 --- /dev/null +++ b/unity-parser/src/types/unity_types/mod.rs @@ -0,0 +1,11 @@ +//! Unity-specific types (GameObjects, Transforms, PrefabInstances) + +pub mod game_object; +pub mod prefab_instance; +pub mod transform; + +pub use game_object::GameObject; +pub use prefab_instance::{ + PrefabInstance, PrefabInstanceComponent, PrefabModification, PrefabResolver, +}; +pub use transform::{RectTransform, Transform}; diff --git a/cursebreaker-parser/src/types/prefab_instance.rs b/unity-parser/src/types/unity_types/prefab_instance.rs similarity index 100% rename from cursebreaker-parser/src/types/prefab_instance.rs rename to unity-parser/src/types/unity_types/prefab_instance.rs diff --git a/cursebreaker-parser/src/types/transform.rs b/unity-parser/src/types/unity_types/transform.rs similarity index 100% rename from cursebreaker-parser/src/types/transform.rs rename to unity-parser/src/types/unity_types/transform.rs diff --git a/cursebreaker-parser/src/types/values.rs b/unity-parser/src/types/values.rs similarity index 100% rename from cursebreaker-parser/src/types/values.rs rename to unity-parser/src/types/values.rs diff --git a/cursebreaker-parser/tests/integration_tests.rs b/unity-parser/tests/integration_tests.rs similarity index 98% rename from cursebreaker-parser/tests/integration_tests.rs rename to unity-parser/tests/integration_tests.rs index b3db41b..1b409e5 100644 --- a/cursebreaker-parser/tests/integration_tests.rs +++ b/unity-parser/tests/integration_tests.rs @@ -1,6 +1,6 @@ //! Integration tests for parsing real Unity projects -use cursebreaker_parser::{GuidResolver, UnityFile}; +use unity_parser::{GuidResolver, UnityFile}; use std::path::{Path, PathBuf}; use std::process::Command; use std::time::Instant; @@ -449,7 +449,7 @@ fn test_guid_resolution() { } // Test resolution by Guid type - use cursebreaker_parser::Guid; + use unity_parser::Guid; let playsfx_guid = Guid::from_hex(playsfx_guid_str).unwrap(); match resolver.resolve_class_name(&playsfx_guid) { Some(class_name) => { @@ -478,7 +478,7 @@ fn test_guid_resolution() { /// Test parsing PlaySFX components from actual scene file #[test] fn test_playsfx_parsing() { - use cursebreaker_parser::UnityComponent; + use unity_parser::UnityComponent; /// PlaySFX component from VR_Horror_YouCantRun #[derive(Debug, Clone, UnityComponent)] @@ -520,8 +520,8 @@ fn test_playsfx_parsing() { println!("\n Parsing scene: {}", scene_path.display()); - match cursebreaker_parser::UnityFile::from_path(&scene_path) { - Ok(cursebreaker_parser::UnityFile::Scene(scene)) => { + match unity_parser::UnityFile::from_path(&scene_path) { + Ok(unity_parser::UnityFile::Scene(scene)) => { println!(" ✓ Scene parsed successfully"); println!(" - Total entities: {}", scene.entity_map.len()); diff --git a/cursebreaker-parser/tests/macro_tests.rs b/unity-parser/tests/macro_tests.rs similarity index 95% rename from cursebreaker-parser/tests/macro_tests.rs rename to unity-parser/tests/macro_tests.rs index 021e703..9ce862e 100644 --- a/cursebreaker-parser/tests/macro_tests.rs +++ b/unity-parser/tests/macro_tests.rs @@ -1,6 +1,6 @@ //! Tests for the #[derive(UnityComponent)] macro -use cursebreaker_parser::{ComponentContext, FileID, UnityComponent}; +use unity_parser::{ComponentContext, FileID, UnityComponent}; /// Test component matching the PlaySFX script from VR_Horror_YouCantRun #[derive(Debug, Clone, UnityComponent)] @@ -133,7 +133,7 @@ fn test_component_registration() { let mut found_play_sfx = false; let mut found_test_component = false; - for reg in inventory::iter:: { + for reg in inventory::iter:: { if reg.class_name == "PlaySFX" { found_play_sfx = true; assert_eq!(reg.type_id, 114); @@ -177,7 +177,7 @@ isLoop: 0 }; // Find the PlaySFX registration and call its parser - for reg in inventory::iter:: { + for reg in inventory::iter:: { if reg.class_name == "PlaySFX" { let result = (reg.parser)(mapping, &ctx); assert!(result.is_some(), "Registered parser failed to parse"); diff --git a/cursebreaker-parser/tests/test_guid_resolution.rs.disabled b/unity-parser/tests/test_guid_resolution.rs.disabled similarity index 100% rename from cursebreaker-parser/tests/test_guid_resolution.rs.disabled rename to unity-parser/tests/test_guid_resolution.rs.disabled