角色能力,存档
This commit is contained in:
@@ -1,14 +1,43 @@
|
||||
using UnityEngine;
|
||||
using BaseGames.Core.Events;
|
||||
|
||||
namespace BaseGames.Player
|
||||
{
|
||||
/// <summary>
|
||||
/// 治愈弹簧系统(架构 05_PlayerModule §7)。
|
||||
/// PlayerStats 中已预留 CurrentSpringCharges / MaxSpringCharges / SpringKillPoints 字段。
|
||||
/// TODO: 实现弹簧充能逻辑:
|
||||
/// - 击杀敌人时调用 PlayerStats.AddSpringKillPoint() 积累充能
|
||||
/// - 按下治愈键时消耗充能槽并恢复玩家 HP
|
||||
/// - 充能满格时触发特殊强化状态(视设计而定)
|
||||
/// 灵泉充能系统(架构 05_PlayerModule §7)。
|
||||
/// 订阅 EVT_EnemyDied 事件,每次击杀调用 PlayerStats.AddKillPoints();
|
||||
/// 积分达到阈值时由 PlayerStats 内部自动增加 SpringCharge 并重置积分。
|
||||
/// 使用灵泉(UseSpring)由 PlayerController 处理输入、SpringState 执行动画与消耗。
|
||||
/// </summary>
|
||||
public class SpringSystem : MonoBehaviour { }
|
||||
public class SpringSystem : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private PlayerStats _stats;
|
||||
[SerializeField] private StringEventChannelSO _onEnemyDied; // EVT_EnemyDied
|
||||
|
||||
private EventSubscription _sub;
|
||||
private bool _subscribed;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (_onEnemyDied != null)
|
||||
{
|
||||
_sub = _onEnemyDied.Subscribe(OnEnemyDied);
|
||||
_subscribed = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (_subscribed)
|
||||
{
|
||||
_sub.Dispose();
|
||||
_subscribed = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEnemyDied(string _enemyId)
|
||||
{
|
||||
_stats?.AddKillPoints(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user