File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
docs/src/ScriptingReference Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ pub struct MyStruct {
1717
1818can be constructed from lua like so:
1919``` lua
20- local MyStruct = world . get_type_by_name ( " MyStruct" )
20+ local MyStruct = types . MyStruct
2121local concrete_my_struct = construct (MyStruct , {
2222 my_field = " hello"
2323})
@@ -33,7 +33,7 @@ pub struct MyTupleStruct(pub String);
3333can be constructed like so:
3434``` lua
3535
36- local MyTupleStruct = world . get_type_by_name ( " MyTupleStruct" )
36+ local MyTupleStruct = types . MyTupleStruct
3737local concrete_my_tuple_struct = construct (MyTupleStruct , {
3838 _1 = " hello"
3939})
@@ -53,7 +53,7 @@ pub enum MyEnum {
5353can be constructed like so:
5454``` lua
5555
56- local MyEnum = world . get_type_by_name ( " MyEnum" )
56+ local MyEnum = types . MyEnum
5757local variantA = construct (MyEnum , {
5858 variant = " VariantA" ,
5959 field = " hello"
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ MyType = world.get_type_by_name("MyType")
2323if MyType == nil then
2424 print (" MyType not found" )
2525end
26+
27+ -- OR
28+ MyType = types .MyType
2629```
2730
2831### get_component
You can’t perform that action at this time.
0 commit comments