摄像机区域的架构改动
This commit is contained in:
40
Assets/_Game/Scripts/Enemies/EnemyPoiseComponent.cs
Normal file
40
Assets/_Game/Scripts/Enemies/EnemyPoiseComponent.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using UnityEngine;
|
||||
using BaseGames.Combat;
|
||||
|
||||
namespace BaseGames.Enemies
|
||||
{
|
||||
/// <summary>
|
||||
/// 敌人霸体组件(架构 06_CombatModule §13)。
|
||||
/// Awake 时自动注入到同节点 HurtBox(无需手动 Inspector 赋值)。
|
||||
/// EnemyBase 或 BehaviorDesigner 任务可调用 SetPoiseLevel / ResetPoiseLevel 切换超甲状态。
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(EnemyBase))]
|
||||
public class EnemyPoiseComponent : MonoBehaviour, IPoiseSource
|
||||
{
|
||||
[SerializeField] private PoiseLevel _defaultPoiseLevel = PoiseLevel.None;
|
||||
|
||||
private PoiseLevel _currentPoiseLevel;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_currentPoiseLevel = _defaultPoiseLevel;
|
||||
|
||||
// 自动注入到同节点 HurtBox(架构 06 §13)
|
||||
if (TryGetComponent<HurtBox>(out var hurtBox))
|
||||
hurtBox.SetPoiseSource(this);
|
||||
}
|
||||
|
||||
// ── IPoiseSource ──────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>返回当前帧的霸体等级(供 HurtBox.ReceiveDamage 步骤 3 比较)。</summary>
|
||||
public PoiseLevel GetCurrentPoiseLevel() => _currentPoiseLevel;
|
||||
|
||||
// ── 外部 API ──────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>进入/退出超甲时由 EnemyBase 或 BehaviorDesigner 任务调用。</summary>
|
||||
public void SetPoiseLevel(PoiseLevel level) => _currentPoiseLevel = level;
|
||||
|
||||
/// <summary>恢复到默认霸体等级(超甲结束时调用)。</summary>
|
||||
public void ResetPoiseLevel() => _currentPoiseLevel = _defaultPoiseLevel;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user