xiandie/scene/ground/script/c03/s04_event_李氏纸人相关.gd
2025-07-30 22:57:38 +08:00

41 lines
708 B
GDScript

@tool
extends Event2D
# var prev_stage := 0
# var stage := 0
func _ready() -> void:
super._ready()
if Engine.is_editor_hint():
return
func _on_global_stage_updated(e: StringName, s: int) -> void:
super._on_global_stage_updated(e, s)
@onready var sfx_cough = $"Sfx2d咳嗽声" as Sfx2D
@onready var sfx_breath = $"Sfx2d纸人呼吸声" as Sfx2D
func _on_ground_ready(_ground: Ground2D) -> void:
_setup_by_stage()
if stage < 3:
Util.timer(3.0, sfx_cough.play)
func _on_pre_stage_updated() -> void:
pass
func _on_stage_updated() -> void:
_setup_by_stage()
func _setup_by_stage() -> void:
if stage >= 2:
# 纸人呼吸声
sfx_breath.play()
if stage == 3:
sfx_cough.easing_kill()