28 lines
540 B
GDScript
28 lines
540 B
GDScript
extends VBoxContainer
|
|
|
|
@export var keySwitchHasKey:bool
|
|
|
|
@export var lightText:String
|
|
|
|
@export var keyText:String
|
|
|
|
|
|
signal clickKeySwitchSignal(openLight:bool,keySwitch)
|
|
|
|
func _ready() -> void:
|
|
$Light/MarginContainer/Label.text=lightText
|
|
if keySwitchHasKey:
|
|
$Key.visible = true
|
|
$Key/MarginContainer/Label.text=keyText
|
|
else:
|
|
$Key.visible = false
|
|
|
|
|
|
func shouHandleKey() -> void:
|
|
$Key/Key.visible = true
|
|
$Key/Right_Rotate.visible = true
|
|
|
|
func hideHandleKey() -> void:
|
|
$Key/Key.visible = false
|
|
$Key/Right_Rotate.visible = false
|