31 lines
514 B
GDScript
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()
|