|
1 | | - |
2 | 1 | extends MainLoop |
3 | 2 |
|
| 3 | + |
4 | 4 | func _initialize(): |
5 | | - OS.exit_code = 1 |
6 | | - var native_script = load("res://gdexample.gdns") |
7 | | - print("Native Script ", native_script) |
8 | | - if native_script == null || !is_instance_valid(native_script): |
9 | | - return |
10 | | - print("Library ", native_script.library) |
11 | | - if native_script.library == null || !is_instance_valid(native_script.library): |
12 | | - return |
13 | | - var ref = native_script.new() |
14 | | - print("Reference ", ref) |
15 | | - if ref == null || !is_instance_valid(ref): |
16 | | - return |
17 | | - print("Reference name ", ref.name) |
18 | | - if ref.name != "SimpleClass": |
19 | | - return |
20 | | - print("Reference value ", ref.value) |
21 | | - if ref.value != 0: |
22 | | - return |
23 | | - print("Call method ", ref.method(1)) |
24 | | - if ref.method(1) != 1: |
25 | | - return |
26 | | - OS.exit_code = 0 |
| 5 | + OS.exit_code = 1 |
| 6 | + var native_script = load("res://gdexample.gdns") |
| 7 | + print("Native Script ", native_script) |
| 8 | + if not native_script || !is_instance_valid(native_script): |
| 9 | + return |
| 10 | + print("Library ", native_script.library) |
| 11 | + if not native_script.library || !is_instance_valid(native_script.library): |
| 12 | + return |
| 13 | + var ref = native_script.new() |
| 14 | + print("Reference ", ref) |
| 15 | + if not ref || !is_instance_valid(ref): |
| 16 | + return |
| 17 | + print("Reference name ", ref.name) |
| 18 | + if ref.name != "SimpleClass": |
| 19 | + return |
| 20 | + print("Reference value ", ref.value) |
| 21 | + if ref.value != 0: |
| 22 | + return |
| 23 | + print("Call method ", ref.method(1)) |
| 24 | + if ref.method(1) != 1: |
| 25 | + return |
| 26 | + OS.exit_code = 0 |
27 | 27 |
|
28 | | -func _idle(_delta): |
29 | | - return true |
30 | 28 |
|
| 29 | +func _idle(_delta): |
| 30 | + return true |
0 commit comments