File tree 2 files changed +6
-3
lines changed
docs/src/ScriptingReference
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ pub struct MyStruct {
17
17
18
18
can be constructed from lua like so:
19
19
``` lua
20
- local MyStruct = world . get_type_by_name ( " MyStruct" )
20
+ local MyStruct = types . MyStruct
21
21
local concrete_my_struct = construct (MyStruct , {
22
22
my_field = " hello"
23
23
})
@@ -33,7 +33,7 @@ pub struct MyTupleStruct(pub String);
33
33
can be constructed like so:
34
34
``` lua
35
35
36
- local MyTupleStruct = world . get_type_by_name ( " MyTupleStruct" )
36
+ local MyTupleStruct = types . MyTupleStruct
37
37
local concrete_my_tuple_struct = construct (MyTupleStruct , {
38
38
_1 = " hello"
39
39
})
@@ -53,7 +53,7 @@ pub enum MyEnum {
53
53
can be constructed like so:
54
54
``` lua
55
55
56
- local MyEnum = world . get_type_by_name ( " MyEnum" )
56
+ local MyEnum = types . MyEnum
57
57
local variantA = construct (MyEnum , {
58
58
variant = " VariantA" ,
59
59
field = " hello"
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ MyType = world.get_type_by_name("MyType")
23
23
if MyType == nil then
24
24
print (" MyType not found" )
25
25
end
26
+
27
+ -- OR
28
+ MyType = types .MyType
26
29
```
27
30
28
31
### get_component
You can’t perform that action at this time.
0 commit comments