pub struct PythonLikeUnityClass<'a> { /* private fields */ }Expand description
Python-like wrapper for Unity classes
This provides dynamic property access similar to Python:
entry.m_Name = "NewName"
health = entry.m_MaxHealth
entry.m_MaxHealth += 10Implementations§
Source§impl<'a> PythonLikeUnityClass<'a>
impl<'a> PythonLikeUnityClass<'a>
Sourcepub fn get_string(&self, key: &str) -> Option<String>
pub fn get_string(&self, key: &str) -> Option<String>
Get a property value with automatic type conversion
§Examples
// Get string property
if let Some(name) = entry.get_string("m_Name") {
println!("Name: {}", name);
}
// Get integer property
if let Some(health) = entry.get_integer("m_MaxHealth") {
println!("Health: {}", health);
}Sourcepub fn get_integer(&self, key: &str) -> Option<i64>
pub fn get_integer(&self, key: &str) -> Option<i64>
Get integer property
Sourcepub fn get_dynamic(&self, key: &str) -> Option<DynamicValue>
pub fn get_dynamic(&self, key: &str) -> Option<DynamicValue>
Get raw dynamic value
Sourcepub fn has_property(&self, key: &str) -> bool
pub fn has_property(&self, key: &str) -> bool
Check if property exists
Sourcepub fn property_names(&self) -> Vec<String>
pub fn property_names(&self) -> Vec<String>
Get all property names
Sourcepub fn class_name(&self) -> &str
pub fn class_name(&self) -> &str
Get class name
Sourcepub fn inner(&self) -> &UnityClass
pub fn inner(&self) -> &UnityClass
Get the underlying UnityClass
Auto Trait Implementations§
impl<'a> Freeze for PythonLikeUnityClass<'a>
impl<'a> RefUnwindSafe for PythonLikeUnityClass<'a>
impl<'a> Send for PythonLikeUnityClass<'a>
impl<'a> Sync for PythonLikeUnityClass<'a>
impl<'a> Unpin for PythonLikeUnityClass<'a>
impl<'a> UnwindSafe for PythonLikeUnityClass<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more