godot-psd-training/UI/psl/key_switch.gd
joylink_zhaoerwei e26fa7b94f psl面板备用
2024-04-19 17:48:20 +08:00

19 lines
344 B
GDScript

extends VBoxContainer
@export var keySwitchHasKey:bool
@export var lightText:String
@export var keyText:String
signal clickKeySwitchSignal(openLight:bool)
func _ready() -> void:
$Light/MarginContainer/Label.text=lightText
if keySwitchHasKey:
$Key.visible = true
$Key/MarginContainer/Label.text=keyText
else:
$Key.visible = false