From fca8d83d1e5c089438095e9d24da2cdd0a2b060a Mon Sep 17 00:00:00 2001 From: cakipaul Date: Wed, 6 Aug 2025 15:00:41 +0800 Subject: [PATCH] =?UTF-8?q?closeup=20=E9=BB=91=E5=B1=8F=E8=BD=AC=E5=9C=BA?= =?UTF-8?q?=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/scene/scene_manager.gd | 4 ++-- scene/effect/黑屏转场.gd | 4 +++- scene/entity/closeup.gd | 6 ++++++ scene/ground/scene/c02/s05_一楼内侧楼道.tscn | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/manager/scene/scene_manager.gd b/manager/scene/scene_manager.gd index d75332cb..9d96ac38 100644 --- a/manager/scene/scene_manager.gd +++ b/manager/scene/scene_manager.gd @@ -493,8 +493,8 @@ func show_black_hand(play_sfx := true, queue_free_delay := 0.0) -> void: var transition_scene = preload("uid://7dxvwqm53ugh") -func black_transition(half_duration := 0.7) -> void: +func black_transition(half_duration := 0.7, wait_time := 0.5) -> void: var scene = transition_scene.instantiate() scene.name = "Transition" get_tree().current_scene.add_child(scene) - scene.run_effect(half_duration) + scene.run_effect(half_duration, wait_time) diff --git a/scene/effect/黑屏转场.gd b/scene/effect/黑屏转场.gd index fc687671..25891e62 100644 --- a/scene/effect/黑屏转场.gd +++ b/scene/effect/黑屏转场.gd @@ -5,12 +5,14 @@ func _ready() -> void: layer = GlobalConfig.CANVAS_LAYER_EFFECT -func run_effect(half_duration := 0.7): +func run_effect(half_duration := 0.7, wait_time := 0.5, color := Color.BLACK): if not is_node_ready(): await ready var rect = $ColorRect as ColorRect var tween = create_tween() + rect.color = color rect.modulate.a = 0 tween.tween_property(rect, "modulate:a", 1.0, half_duration) + tween.tween_interval(wait_time) tween.tween_property(rect, "modulate:a", 0.0, half_duration) tween.tween_callback(queue_free) diff --git a/scene/entity/closeup.gd b/scene/entity/closeup.gd index 7f3c2f2f..48c3ef10 100644 --- a/scene/entity/closeup.gd +++ b/scene/entity/closeup.gd @@ -11,6 +11,8 @@ signal exit(arg) @export var on_display_hide_hud := false @export var on_display_change_volumn := true @export var on_display_changed_volumn_db := -7.0 +# 转场效果 1s +@export var transition_effect := true @export_tool_button("新建特写场景") var create_closeup_scene = _create_scene_with_script # 在 exit 信号前,禁用 cancel var _holding_cancel_before_exit := false @@ -42,6 +44,10 @@ func display() -> void: SceneManager.lock_player(0, action_key) # 展示时,禁用 sign_mark 的输入 sign_mark.pass_unhandled_input = true + # 转场效果 + if transition_effect: + SceneManager.black_transition(0.5, 0.1) + await Util.wait(0.55) current_child = packed_scene.instantiate() add_child(current_child) if current_child.has_signal("exit"): diff --git a/scene/ground/scene/c02/s05_一楼内侧楼道.tscn b/scene/ground/scene/c02/s05_一楼内侧楼道.tscn index 4c83dd54..740fb13c 100644 --- a/scene/ground/scene/c02/s05_一楼内侧楼道.tscn +++ b/scene/ground/scene/c02/s05_一楼内侧楼道.tscn @@ -218,7 +218,7 @@ range_item_cull_mask = 4 texture = ExtResource("8_mrltr") [node name="Closeup戏台" parent="Ground/DeployLayer" index="7" instance=ExtResource("10_2yvhw")] -position = Vector2(305, -249) +position = Vector2(314, 30) packed_scene = ExtResource("11_2yvhw") on_display_hide_hud = true first_interact_os_key = "c02_一楼戏台"