xiandie/scene/ground/script/c01/s10_鬼差探头.gd

43 lines
1.2 KiB
GDScript3
Raw Normal View History

2025-06-25 17:53:16 +00:00
extends CanvasLayer
2025-03-09 14:01:51 +00:00
var dialogue_c01 := preload("res://asset/dialogue/c01.dialogue") as DialogueResource
2025-06-25 17:53:16 +00:00
func _ready() -> void:
layer = GlobalConfig.CANVAS_LAYER_LITTLE_GAME
# self.modulate = Color.BLACK
# var tween = create_tween()
# tween.tween_property(self, "modulate", Color.WHITE, 0.5)
$Sfx.play()
var animation_player = $AnimationPlayer as AnimationPlayer
animation_player.play("鬼差探头")
2025-06-25 17:53:16 +00:00
animation_player.animation_finished.connect(_on_finished)
func play_bgm():
# 音效
var stream = $"背景音".stream
AudioManager.loop_bgm_music("黄包车背景音效", stream)
2025-06-25 17:53:16 +00:00
func pre_finished():
# 在 animation player 结束前 1 秒调用
var camera = SceneManager.get_camera_marker()
camera.limit_top -= 20
camera.limit_bottom += 20
camera.limit_left -= 20
camera.limit_right += 20
camera.shake_camera(8.0, 2.0)
# debug 模式允许跳过
if GlobalConfig.DEBUG:
DialogueManager.show_dialogue_balloon(dialogue_c01, "c01_s11_车夫对话1")
else:
DialogueManager.show_dialogue_balloon(
dialogue_c01, "c01_s11_车夫对话1", [GlobalConfig.DIALOG_IGNORE_INPUT]
)
2025-06-25 17:53:16 +00:00
func _on_finished(_a):
# 跳转场景
SceneManager.get_ground_loader().transition_to_scene("c01_s11", "left")