43 lines
1.2 KiB
GDScript
43 lines
1.2 KiB
GDScript
extends CanvasLayer
|
|
|
|
var dialogue_c01 := preload("res://asset/dialogue/c01.dialogue") as DialogueResource
|
|
|
|
|
|
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("鬼差探头")
|
|
animation_player.animation_finished.connect(_on_finished)
|
|
|
|
|
|
func play_bgm():
|
|
# 音效
|
|
var stream = $"背景音".stream
|
|
AudioManager.loop_bgm_music("黄包车背景音效", stream)
|
|
|
|
|
|
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]
|
|
)
|
|
|
|
|
|
func _on_finished(_a):
|
|
# 跳转场景
|
|
SceneManager.get_ground_loader().transition_to_scene("c01_s11", "left")
|