From 4a98f032dd86307a038c189fcbf593ae7549de95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=A8=E8=90=BD=E5=9F=BA=E5=9B=B4=E8=99=BE?= <3161880837@qq.com> Date: Fri, 1 May 2026 13:05:42 +0800 Subject: [PATCH] =?UTF-8?q?refactor(BroomBoomerang):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=A2=B0=E6=92=9E=E5=BD=A2=E7=8A=B6=E4=B8=BA=E7=9F=A9=E5=BD=A2?= =?UTF-8?q?=E5=B9=B6=E6=B7=BB=E5=8A=A0=E5=90=8C=E6=AD=A5=E5=8F=98=E6=8D=A2?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将圆形碰撞形状改为矩形以更符合视觉效果,并添加SyncTransform脚本实现碰撞体与动画节点的同步变换 --- components/Bullets/BroomBoomerang.tscn | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/components/Bullets/BroomBoomerang.tscn b/components/Bullets/BroomBoomerang.tscn index 7b0ab7d..9fffc4b 100644 --- a/components/Bullets/BroomBoomerang.tscn +++ b/components/Bullets/BroomBoomerang.tscn @@ -4,6 +4,7 @@ [ext_resource type="Script" uid="uid://k63hoju1eyd" path="res://scripts/Contents/Bullets/BroomBoomerang.gd" id="2_14u4g"] [ext_resource type="Texture2D" uid="uid://caf67vt47y180" path="res://resources/bullets/swords/broom.svg" id="3_wnwnl"] [ext_resource type="Texture2D" uid="uid://d2pndtow16635" path="res://resources/bullets/lgbt-bullet/造型2.svg" id="4_wnwnl"] +[ext_resource type="Script" uid="uid://ckc6guqib3rno" path="res://scripts/Statemachine/SyncTransform.gd" id="5_0vfy6"] [sub_resource type="SpriteFrames" id="SpriteFrames_0vfy6"] animations = [{ @@ -140,8 +141,8 @@ scale_curve = SubResource("CurveTexture_g0gbx") color_initial_ramp = SubResource("GradientTexture1D_evbtt") alpha_curve = SubResource("CurveTexture_wnwnl") -[sub_resource type="CircleShape2D" id="CircleShape2D_wnwnl"] -radius = 124.01613 +[sub_resource type="RectangleShape2D" id="RectangleShape2D_wnwnl"] +size = Vector2(125, 40) [node name="BroomBoomerang" unique_id=5571707 instance=ExtResource("1_2ngbh")] script = ExtResource("2_14u4g") @@ -154,7 +155,7 @@ autoLoopAnimation = true autoDestroyAnimation = true [node name="texture" parent="." index="0" unique_id=162977358] -rotation = 6.2831855 +rotation = 4.970905 sprite_frames = SubResource("SpriteFrames_0vfy6") [node name="animator" parent="texture" index="0" unique_id=1114087117] @@ -163,7 +164,18 @@ libraries/ = SubResource("AnimationLibrary_evbtt") [node name="trail" type="GPUParticles2D" parent="texture" index="2" unique_id=1139927837] amount = 200 texture = ExtResource("4_wnwnl") +visibility_rect = Rect2(-1000, -1000, 2000, 2000) process_material = SubResource("ParticleProcessMaterial_m5hsn") -[node name="hitbox" parent="." index="1" unique_id=175349408] -shape = SubResource("CircleShape2D_wnwnl") +[node name="anchor" type="Node2D" parent="texture" index="3" unique_id=662288747] +position = Vector2(-60, 0) + +[node name="hitbox" parent="." index="1" unique_id=175349408 node_paths=PackedStringArray("target")] +position = Vector2(-15.338759, 58.00623) +rotation = -1.3122805 +shape = SubResource("RectangleShape2D_wnwnl") +script = ExtResource("5_0vfy6") +target = NodePath("../texture/anchor") +enablePosition = true +enableRotation = true +enableScale = true