ClassName

This commit is contained in:
Quaternions 2024-10-03 18:03:42 -07:00
parent 7403888348
commit 748f544a4b

View File

@ -112,6 +112,12 @@ impl Instance{
Ok(()) Ok(())
}) })
}); });
fields.add_field_method_get("ClassName",|lua,this|{
dom(lua,|dom|{
let instance=this.get(dom)?;
Ok(instance.class.clone())
})
});
} }
fn composition_add_methods<'lua,T:Referent,M:mlua::UserDataMethods<'lua,T>>(methods:&mut M){ fn composition_add_methods<'lua,T:Referent,M:mlua::UserDataMethods<'lua,T>>(methods:&mut M){
methods.add_method("GetChildren",|lua,this,_:()| methods.add_method("GetChildren",|lua,this,_:()|