27 lines
745 B
GDScript3
27 lines
745 B
GDScript3
|
extends CanvasLayer
|
||
|
|
||
|
signal exit(success: bool)
|
||
|
|
||
|
@onready var button = $TextureButton as TextureButton
|
||
|
|
||
|
var texture_dict = {
|
||
|
"0": preload("res://asset/art/scene/c02/s04_保卫科/折叠元宝/0.png"),
|
||
|
"1": preload("res://asset/art/scene/c02/s04_保卫科/折叠元宝/1.png"),
|
||
|
"2": preload("res://asset/art/scene/c02/s04_保卫科/折叠元宝/2.png"),
|
||
|
"3": preload("res://asset/art/scene/c02/s04_保卫科/折叠元宝/3.png")
|
||
|
}
|
||
|
|
||
|
var current_texture = 0
|
||
|
|
||
|
func _ready() -> void:
|
||
|
layer = GlobalConfig.CANVAS_LAYER_LITTLE_GAME
|
||
|
button.pressed.connect(_on_button_pressed)
|
||
|
|
||
|
|
||
|
func _on_button_pressed() -> void:
|
||
|
if current_texture == 3:
|
||
|
exit.emit(true)
|
||
|
else:
|
||
|
current_texture += 1
|
||
|
button.texture_normal = texture_dict[str(current_texture)]
|