xiandie/scene/ground/script/c03/s04_event_2d香炉.gd
2025-07-25 21:25:15 +08:00

31 lines
514 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
func _on_ground_ready(_ground: Ground2D) -> void:
if stage != 3:
Util.timer(3.0, sfx_cough.play)
func _on_pre_stage_updated() -> void:
pass
func _on_stage_updated() -> void:
if stage == 3:
sfx_cough.stop()