43 lines
966 B
GDScript
43 lines
966 B
GDScript
@tool
|
|
extends AnimationRoot
|
|
|
|
|
|
# 覆盖该方法
|
|
func _default_data() -> Dictionary:
|
|
return {
|
|
# # 雾是否已经消失, 第一次进入时为 false
|
|
# "fog_disappeared": false,
|
|
}
|
|
|
|
|
|
func _ready() -> void:
|
|
super._ready()
|
|
if Engine.is_editor_hint():
|
|
return
|
|
|
|
|
|
var ghost
|
|
|
|
|
|
func _on_ground_ready() -> void:
|
|
ghost = $"../DeployLayer/Ghost"
|
|
_ghost_move()
|
|
|
|
|
|
func _ghost_move() -> void:
|
|
if GlobalConfig.DEBUG:
|
|
print("鬼差移动")
|
|
ghost.visible = true
|
|
var tween = create_tween()
|
|
tween.tween_property(ghost, "global_position", Vector2(4000, 0), 30.0).as_relative()
|
|
tween = create_tween()
|
|
tween.tween_interval(15.0)
|
|
tween.tween_property(ghost, "modulate:a", 0.0, 10.0)
|
|
ghost.get_node("脚步声2D").start_loop()
|
|
|
|
|
|
func player_been_passed() -> void:
|
|
# 玩家被抓: 公寓楼前玩家不被抓,擦肩而过,可以有擦肩而过的音效
|
|
SceneManager.pop_debug_dialog_info("音效", "鬼差擦肩而过")
|
|
ghost.get_node("Sfx鬼差擦肩而过").play()
|