From 82751747af0b444d4c04c3f45ba631f90bea018e 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, 26 Sep 2025 06:49:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=AD=90=E5=BC=B9=E6=95=88=E6=9E=9C):=20?= =?UTF-8?q?=E4=B8=BA=E4=B8=83=E9=AD=82=E5=AD=90=E5=BC=B9=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=B2=92=E5=AD=90=E6=95=88=E6=9E=9C=E5=B9=B6=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改子弹脚本以支持粒子效果发射 调整颜色应用逻辑从heart节点转移到父节点 为SoulBall和SevenSoul场景添加粒子系统配置 --- components/Bullets/SevenSoul.tscn | 36 ++++++++++++++++++++++++++- components/Bullets/SoulBall.tscn | 3 +++ scripts/Contents/Bullets/SevenSoul.gd | 4 ++- 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/components/Bullets/SevenSoul.tscn b/components/Bullets/SevenSoul.tscn index 92c2aa7..29f6cee 100644 --- a/components/Bullets/SevenSoul.tscn +++ b/components/Bullets/SevenSoul.tscn @@ -1,9 +1,32 @@ -[gd_scene load_steps=4 format=3 uid="uid://bymprh2qel2oj"] +[gd_scene load_steps=9 format=3 uid="uid://bymprh2qel2oj"] [ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_c4fl5"] [ext_resource type="Script" path="res://scripts/Contents/Bullets/SevenSoul.gd" id="2_egs34"] [ext_resource type="Texture2D" uid="uid://wy10fc3bqppg" path="res://resources/bullets/seven-soul/soul.png" id="2_itucu"] +[sub_resource type="Curve" id="Curve_0y25k"] +_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.497908, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 3 + +[sub_resource type="CurveTexture" id="CurveTexture_d1eej"] +curve = SubResource("Curve_0y25k") + +[sub_resource type="Curve" id="Curve_acuqr"] +max_value = 4.0 +_data = [Vector2(0, 1), 0.0, 3.0, 0, 1, Vector2(1, 4), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_cokmd"] +curve = SubResource("Curve_acuqr") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_4d30u"] +particle_flag_disable_z = true +gravity = Vector3(0, 0, 0) +scale_min = 1.5 +scale_max = 1.5 +scale_curve = SubResource("CurveTexture_cokmd") +alpha_curve = SubResource("CurveTexture_d1eej") + [node name="SevenSoul" instance=ExtResource("1_c4fl5")] script = ExtResource("2_egs34") lifeTime = 112000.0 @@ -14,5 +37,16 @@ position = Vector2(100, 0) scale = Vector2(1.5, 1.5) texture = ExtResource("2_itucu") +[node name="effect" type="GPUParticles2D" parent="texture" index="2"] +unique_name_in_owner = true +position = Vector2(100, 0) +emitting = false +amount = 1 +process_material = SubResource("ParticleProcessMaterial_4d30u") +texture = ExtResource("2_itucu") +lifetime = 0.5 +one_shot = true +local_coords = true + [node name="hitbox" parent="." index="1"] disabled = true diff --git a/components/Bullets/SoulBall.tscn b/components/Bullets/SoulBall.tscn index b566464..15fb374 100644 --- a/components/Bullets/SoulBall.tscn +++ b/components/Bullets/SoulBall.tscn @@ -33,6 +33,8 @@ curve = SubResource("Curve_orogq") particle_flag_disable_z = true direction = Vector3(-1, 0, 0) spread = 0.0 +initial_velocity_min = 300.0 +initial_velocity_max = 300.0 gravity = Vector3(0, 0, 0) scale_curve = SubResource("CurveTexture_pftyf") alpha_curve = SubResource("CurveTexture_5wobk") @@ -52,6 +54,7 @@ amount = 10 process_material = SubResource("ParticleProcessMaterial_vwon6") texture = ExtResource("2_fmlef") lifetime = 0.5 +local_coords = true [node name="hitbox" parent="." index="1"] visible = false diff --git a/scripts/Contents/Bullets/SevenSoul.gd b/scripts/Contents/Bullets/SevenSoul.gd index 60b5eea..d45cb12 100644 --- a/scripts/Contents/Bullets/SevenSoul.gd +++ b/scripts/Contents/Bullets/SevenSoul.gd @@ -11,9 +11,11 @@ var colors = [ var index = 0 @onready var heart = $"%heart" +@onready var effect: GPUParticles2D = $"%effect" func spawn(): - heart.modulate = Color(colors[index % colors.size()]) + modulate = Color(colors[index % colors.size()]) + effect.emitting = true func ai(): rotation_degrees = 360.0 / colors.size() * index + timeLived() / 20000.0 * 360 - index / 6.0 * 360.0 heart.global_rotation_degrees = 0