mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-07-09 19:42:54 +08:00
fix(Statemachine): 修复攻击逻辑中声音播放与攻击执行顺序问题
调整攻击逻辑,确保在攻击成功时才播放攻击音效,避免音效与攻击动作不同步
This commit is contained in:
@@ -200,9 +200,8 @@ func tryAttack(type: int, needChargeUp: bool = false):
|
|||||||
charginup = true
|
charginup = true
|
||||||
await EffectController.create(preload("res://components/Effects/AttackStar.tscn"), damageAnchor.global_position).shot()
|
await EffectController.create(preload("res://components/Effects/AttackStar.tscn"), damageAnchor.global_position).shot()
|
||||||
charginup = false
|
charginup = false
|
||||||
else:
|
if attack(type):
|
||||||
playSound("attack" + str(type))
|
playSound("attack" + str(type))
|
||||||
attack(type)
|
|
||||||
return state
|
return state
|
||||||
func trySprint():
|
func trySprint():
|
||||||
trailing = true
|
trailing = true
|
||||||
|
|||||||
Reference in New Issue
Block a user