workspace.Terrain

This commit is contained in:
Quaternions 2024-10-04 19:05:05 -07:00
parent 96c8b1035a
commit acbb1c8478

View File

@ -333,8 +333,20 @@ impl DataModel{
}
class!(Workspace);
class_composition!(Workspace,(Instance));
class_composition!(Workspace,(Instance,Workspace));
impl Workspace{
fn composition_add_fields<'lua,T:Referent,F:mlua::UserDataFields<'lua,T>>(fields:&mut F){
fields.add_field_method_get("Terrain",|lua,this|{
dom(lua,|dom|{
Ok(find_first_child_of_class(dom,this.get(dom)?,"Terrain")
.map(|inst|Terrain::new(inst.referent()))
)
})
});
}
fn composition_add_methods<'lua,T,M:mlua::UserDataMethods<'lua,T>>(_methods:&mut M){
}
}
class!(Lighting);
class_composition!(Lighting,(Instance));