26 lines
660 B
GDScript
26 lines
660 B
GDScript
extends CanvasLayer
|
|
|
|
signal exit(success: bool)
|
|
|
|
@onready var button = $TextureButton as TextureButton
|
|
|
|
var texture_dict = {
|
|
"0": preload("res://asset/art/scene/c02/s04_保卫科/花名册/花名册封皮.png"),
|
|
"1": preload("res://asset/art/scene/c02/s04_保卫科/花名册/翻开页.png"),
|
|
}
|
|
|
|
var click_count = 0
|
|
|
|
func _ready() -> void:
|
|
layer = GlobalConfig.CANVAS_LAYER_LITTLE_GAME
|
|
button.pressed.connect(_on_button_pressed)
|
|
|
|
|
|
func _on_button_pressed() -> void:
|
|
click_count += 1
|
|
if click_count == 1:
|
|
button.texture_normal = texture_dict["1"]
|
|
button.set_anchors_preset(Control.PRESET_CENTER)
|
|
else:
|
|
$HBoxContainer.visible = click_count % 2 == 0
|