mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-01 17:01:53 +08:00
feat(武器/特效): 新增扶桑元神武器及爆炸特效
添加扶桑元神武器相关资源及功能实现,包括: - 新增武器图标、描述和属性配置 - 实现格挡子弹并生成乾坤剑的逻辑 - 添加符咒爆炸特效及相关动画资源 - 调整乾坤剑伤害值和生成位置 - 优化武器特效控制器支持纹理动画
This commit is contained in:
@@ -4,10 +4,12 @@ class_name EffectController
|
||||
@export var oneShot: bool = true
|
||||
@export var spawnSound: String = ""
|
||||
@export var spawnAnimation: String = ""
|
||||
@export var spawnTexture: String = ""
|
||||
|
||||
@onready var particles: GPUParticles2D = $"%particles"
|
||||
@onready var sounds: Node2D = $"%sounds"
|
||||
@onready var animator: AnimationPlayer = $"%animator"
|
||||
@onready var texture: AnimatedSprite2D = $"%texture"
|
||||
|
||||
func _ready():
|
||||
register()
|
||||
@@ -18,17 +20,25 @@ func _ready():
|
||||
sound.play()
|
||||
if spawnAnimation:
|
||||
animator.play(spawnAnimation)
|
||||
if spawnTexture:
|
||||
texture.play(spawnTexture)
|
||||
func shot():
|
||||
var cloned = particles.duplicate() as GPUParticles2D
|
||||
cloned.emitting = true
|
||||
add_child(cloned)
|
||||
var childParticle = particles.duplicate() as GPUParticles2D
|
||||
childParticle.emitting = true
|
||||
add_child(childParticle)
|
||||
if oneShot:
|
||||
await cloned.finished
|
||||
cloned.queue_free()
|
||||
await childParticle.finished
|
||||
childParticle.queue_free()
|
||||
if spawnSound:
|
||||
var sound: AudioStreamPlayer2D = sounds.get_node(spawnSound)
|
||||
if sound.playing:
|
||||
await sound.finished
|
||||
if spawnAnimation:
|
||||
if animator.is_playing():
|
||||
await animator.animation_finished
|
||||
if spawnTexture:
|
||||
if texture.is_playing():
|
||||
await texture.animation_finished
|
||||
queue_free()
|
||||
|
||||
func register():
|
||||
|
||||
Reference in New Issue
Block a user