38 lines
814 B
GDScript
38 lines
814 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):
|
|
super._on_global_stage_updated(e, s)
|
|
|
|
|
|
func _on_ground_ready(ground: Ground2D):
|
|
_on_stage_updated()
|
|
|
|
func _on_pre_stage_updated():
|
|
pass
|
|
|
|
func _on_stage_updated():
|
|
# 0初始隐藏 1准备播放 2播放结束隐藏
|
|
if stage == 1:
|
|
var ambush = $"Ambush走到尽头后小蝉跑" as Ambush2D
|
|
ambush.enabled = true
|
|
var sprite = $"AutoplayAnimatedSprite"
|
|
ambush.triggered.connect(func():
|
|
sprite.play("c00_头套小婵_run")
|
|
SceneManager.lock_player()
|
|
SceneManager.pop_os_with_str("c02_二楼小蝉跑掉")
|
|
await Util.wait(3.0)
|
|
SceneManager.unlock_player()
|
|
EventManager.set_stage(event, 2)
|
|
)
|
|
|