1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-09 21:27:13 +08:00

feat(子弹效果): 添加HXD子弹爆炸效果及资源

添加HXDBoom效果控制器和5种爆炸纹理
调整HXD子弹的缩放比例并添加爆炸效果触发
扩展EffectController基类以支持自定义注册逻辑
This commit is contained in:
2026-02-02 10:05:27 +08:00
parent dd479b0d7b
commit 1022dd5024
16 changed files with 248 additions and 1 deletions
+1
View File
@@ -14,6 +14,7 @@ func succeedToHit(_dmg: float, entity: EntityBase):
if is_instance_valid(newEntity):
look_at(newEntity.position)
bouncedTime += 1
EffectController.create(ComponentManager.getEffect("HXDBoom"), position).shot()
func split(newBullet: BulletBase, _index: int, _total: int, _lastBullet: float):
if newBullet is HXDBullet:
newBullet.bouncedTime = 0
+4
View File
@@ -0,0 +1,4 @@
extends EffectController
func register():
particles.texture = load("res://resources/bullets/HXD/effect/%d.png" % randi_range(0, 4))
+1
View File
@@ -0,0 +1 @@
uid://bxvgpyb3fyko1
+4
View File
@@ -10,6 +10,7 @@ class_name EffectController
@onready var animator: AnimationPlayer = $"%animator"
func _ready():
register()
particles.emitting = false
particles.one_shot = oneShot
var sound = sounds.get_node_or_null(spawnSound)
@@ -30,6 +31,9 @@ func shot():
await sound.finished
queue_free()
func register():
pass
static func create(scene: PackedScene, spawnPosition: Vector2, parent: Node = null) -> EffectController:
var cloned = scene.instantiate() as EffectController
cloned.global_position = spawnPosition