xiandie/scene/ground/script/c03/s03_closeup镜子特写.gd

20 lines
583 B
GDScript

extends CanvasLayer
@onready var bg = $BG as TextureRect
@onready var rope_with_mahjong = $"Draggable2D麻绳" as Draggable2D
func _ready() -> void:
layer = GlobalConfig.CANVAS_LAYER_LITTLE_GAME
var mahjong_picked = ArchiveManager.get_global_value("c03_s03_mahjong_picked")
if mahjong_picked:
rope_with_mahjong.queue_free()
else:
rope_with_mahjong.picked.connect(_on_btn_pressed, CONNECT_ONE_SHOT)
func _on_btn_pressed(_arg):
ArchiveManager.set_global_entry("c03_s03_mahjong_picked", true)
SceneManager.enable_prop_item("prop_麻将2")
rope_with_mahjong.queue_free()