Add tests for get_tree() and potential fixes for it missing
This commit is contained in:
parent
f8c5e4e162
commit
6b6c1db55e
2 changed files with 11 additions and 0 deletions
9
addons/besseretests/examples/test_inside_tree.gd
Normal file
9
addons/besseretests/examples/test_inside_tree.gd
Normal file
|
@ -0,0 +1,9 @@
|
|||
extends BessereTestsTest
|
||||
|
||||
func test_boolean() -> void:
|
||||
if is_inside_tree(): test_status = 0
|
||||
else: test_status = 2
|
||||
|
||||
func test_existance() -> void:
|
||||
if get_tree() == null: test_status = 2
|
||||
else: test_status = 0
|
|
@ -19,6 +19,8 @@ var stats_forgot: int = 0
|
|||
var stats_unknown: int = 0
|
||||
|
||||
func _ready() -> void:
|
||||
await get_tree().process_frame
|
||||
|
||||
# Load configuration
|
||||
if FileAccess.file_exists(config_path):
|
||||
config.set_script(load(config_path))
|
||||
|
|
Loading…
Reference in a new issue