pub struct TypeTree {
pub nodes: Vec<TypeTreeNode>,
pub string_buffer: Vec<u8>,
pub version: u32,
pub platform: u32,
pub has_type_dependencies: bool,
}Expand description
Complete TypeTree structure
This structure contains the complete type information for a Unity object, including all field definitions and their relationships.
Fields§
§nodes: Vec<TypeTreeNode>Root nodes of the type tree
string_buffer: Vec<u8>String buffer for type and field names
version: u32Version of the type tree format
platform: u32Platform target
has_type_dependencies: boolWhether type tree has type dependencies
Implementations§
Source§impl TypeTree
impl TypeTree
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a TypeTree with initial capacity
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get the number of root nodes
Sourcepub fn add_node(&mut self, node: TypeTreeNode)
pub fn add_node(&mut self, node: TypeTreeNode)
Add a root node
Sourcepub fn find_node(&self, name: &str) -> Option<&TypeTreeNode>
pub fn find_node(&self, name: &str) -> Option<&TypeTreeNode>
Find a root node by name
Sourcepub fn find_node_mut(&mut self, name: &str) -> Option<&mut TypeTreeNode>
pub fn find_node_mut(&mut self, name: &str) -> Option<&mut TypeTreeNode>
Find a root node by name (mutable)
Sourcepub fn node_names(&self) -> Vec<&str>
pub fn node_names(&self) -> Vec<&str>
Get all root node names
Sourcepub fn name_peek_prefix(&self) -> Option<(usize, String)>
pub fn name_peek_prefix(&self) -> Option<(usize, String)>
Return the minimal root-child prefix length needed to read an object name field.
This is inspired by UnityPy’s peek_name() strategy: we parse only the first N root fields,
stopping at m_Name/name instead of reading the full object.
Sourcepub fn get_string(&self, offset: u32) -> Option<String>
pub fn get_string(&self, offset: u32) -> Option<String>
Get string from buffer at offset
Sourcepub fn add_string(&mut self, s: &str) -> u32
pub fn add_string(&mut self, s: &str) -> u32
Add string to buffer and return offset
Sourcepub fn statistics(&self) -> TypeTreeStatistics
pub fn statistics(&self) -> TypeTreeStatistics
Get TypeTree statistics