20 lines
499 B
GDScript
20 lines
499 B
GDScript
extends Node
|
|
|
|
var parent: CharacterBody3D
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
assert(get_parent().name == "Player", "Upgrade must have player as parent")
|
|
parent = get_parent()
|
|
|
|
## Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
#func _process(delta: float) -> void:
|
|
#pass
|
|
|
|
func update() -> void:
|
|
var upgrades: Array = get_children()
|
|
print("Updating all upgrades...")
|
|
for upgrade in upgrades:
|
|
upgrade.update()
|
|
|