chore: initial commit

This commit is contained in:
2026-05-08 11:04:00 +08:00
commit f55d2a57c3
6278 changed files with 866081 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
using UnityEngine;
using BaseGames.Combat;
namespace BaseGames.Enemies
{
/// <summary>
/// 敌人战斗组件Phase 1 桩,架构 07_EnemyModule §4
/// Phase 2 实现HitBox 按 AttackType 索引管理、伤害来源 SO 注入。
/// </summary>
public class EnemyCombat : MonoBehaviour
{
[SerializeField] private HitBox[] _hitBoxes; // Inspector 按 AttackType 索引绑定
public void StartAttack(AttackType type)
{
// Phase 1 桩Phase 2 播放攻击动画,由 AnimationEvent 触发 HitBox On/Off
int idx = (int)type;
EnableHitBox(idx);
}
public void EnableHitBox(int index)
{
if (_hitBoxes == null || index >= _hitBoxes.Length) return;
_hitBoxes[index]?.Activate();
}
public void DisableHitBox(int index)
{
if (_hitBoxes == null || index >= _hitBoxes.Length) return;
_hitBoxes[index]?.Deactivate();
}
public void DisableAllHitBoxes()
{
if (_hitBoxes == null) return;
foreach (var hb in _hitBoxes) hb?.Deactivate();
}
}
}