1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

GDScript: Fix some bugs with static variables and functions

This commit is contained in:
Danil Alexeev
2023-05-16 13:03:53 +03:00
parent 598378513b
commit aebbbda080
21 changed files with 624 additions and 194 deletions

View File

@@ -33,24 +33,24 @@ func test():
prints("perm:", perm)
prints("prop:", prop)
print("other.perm:", StaticVariablesOther.perm)
print("other.prop:", StaticVariablesOther.prop)
prints("other.perm:", StaticVariablesOther.perm)
prints("other.prop:", StaticVariablesOther.prop)
StaticVariablesOther.perm = 2
StaticVariablesOther.prop = "foo"
print("other.perm:", StaticVariablesOther.perm)
print("other.prop:", StaticVariablesOther.prop)
prints("other.perm:", StaticVariablesOther.perm)
prints("other.prop:", StaticVariablesOther.prop)
@warning_ignore("unsafe_method_access")
var path = get_script().get_path().get_base_dir()
var other = load(path + "/static_variables_load.gd")
var other = load(path + "/static_variables_load.gd")
print("load.perm:", other.perm)
print("load.prop:", other.prop)
prints("load.perm:", other.perm)
prints("load.prop:", other.prop)
other.perm = 3
other.prop = "bar"
print("load.perm:", other.perm)
print("load.prop:", other.prop)
prints("load.perm:", other.perm)
prints("load.prop:", other.prop)