GDScript: Call implicit ready on base script first
It is generally expected that the base class is called before the inherited clas. This commit implements this behavior for the implicit ready function (`@onready` annotation) to make it consistent with the expectations.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#GH-63329
|
||||
class A extends Node:
|
||||
@onready var a := get_value("a")
|
||||
|
||||
func get_value(var_name: String) -> String:
|
||||
print(var_name)
|
||||
return var_name
|
||||
|
||||
class B extends A:
|
||||
@onready var b := get_value("b")
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
func test():
|
||||
var node := B.new()
|
||||
node._ready()
|
||||
node.free()
|
||||
@@ -0,0 +1,3 @@
|
||||
GDTEST_OK
|
||||
a
|
||||
b
|
||||
Reference in New Issue
Block a user