增加敌人攻击动作v0.1
This commit is contained in:
@@ -73,6 +73,9 @@ namespace IndianOceanAssets.Engine2_5D
|
||||
[Tooltip("攻击动画触发器名称(Animator Trigger)")]
|
||||
[SerializeField] private string attackAnimTrigger = "Attack";
|
||||
|
||||
[Tooltip("攻击时播放的粒子特效预制体")]
|
||||
[SerializeField] private GameObject attackParticlePrefab;
|
||||
|
||||
// 状态枚举
|
||||
private enum State
|
||||
{
|
||||
@@ -234,6 +237,14 @@ namespace IndianOceanAssets.Engine2_5D
|
||||
{
|
||||
_animator.SetTrigger(attackAnimTrigger);
|
||||
}
|
||||
|
||||
// 播放攻击粒子特效(生成在玩家位置,模拟命中效果)
|
||||
if (attackParticlePrefab != null)
|
||||
{
|
||||
Vector3 spawnPos = playerTarget != null ? playerTarget.position : transform.position;
|
||||
GameObject fx = Instantiate(attackParticlePrefab, spawnPos, transform.rotation);
|
||||
Destroy(fx, 2f);
|
||||
}
|
||||
}
|
||||
|
||||
// ===== ChasingBell:追击铃铛 =====
|
||||
|
||||
Reference in New Issue
Block a user