1
0
Fork 0
1bit-godot-course/metroidvania/Scenes/UI/MissilesUI.gd

16 lines
413 B
GDScript3
Raw Normal View History

2021-05-18 18:43:07 +00:00
extends HBoxContainer
var PlayerStats = ResourceLoader.PlayerStats
onready var label = $Label
func _ready():
PlayerStats.connect("player_missiles_changed", self, "_on_player_missiles_changed")
2021-05-18 19:05:50 +00:00
PlayerStats.connect("player_missiles_unlocked", self, "_on_player_missiles_unlocked")
2021-05-18 18:43:07 +00:00
func _on_player_missiles_changed(value):
label.text = str(value)
2021-05-18 19:05:50 +00:00
func _on_player_missiles_unlocked(value):
visible = value