1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

feat(BulletBase): 添加自动销毁动画功能

为子弹基类添加 autoDestroyAnimation 导出变量,当设置为 true 时会在销毁时播放销毁动画
This commit is contained in:
2025-08-29 11:37:25 +08:00
parent 96430162b4
commit 7a56644b45
2 changed files with 11 additions and 1 deletions
+4
View File
@@ -11,6 +11,7 @@ class_name BulletBase
@export var needEnergy: float = 0.0 # 发射时需要消耗的能量
@export var autoSpawnAnimation: bool = false
@export var autoLoopAnimation: bool = false
@export var autoDestroyAnimation: bool = false
@export var freeAfterSpawn: bool = false
@export var knockback: float = 0 # 击退力,物理引擎单位
@export var recoil: float = 0 # 后坐力,物理引擎单位
@@ -74,6 +75,9 @@ func dotLoop():
func ai():
pass
func destroy():
if autoDestroyAnimation:
animator.play("destroy")
await animator.animation_finished
queue_free()
func spawn():
pass