chore: initial commit
This commit is contained in:
30
Assets/Scripts/Parry/ParrySystem.cs
Normal file
30
Assets/Scripts/Parry/ParrySystem.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace BaseGames.Parry
|
||||
{
|
||||
/// <summary>
|
||||
/// 弹反状态管理器。Phase 1 桩 — Phase 2 实现。
|
||||
/// 只负责维护「当前是否处于弹反窗口」,不感知任何伤害数据类型。
|
||||
/// HurtBox(Combat 层)主动调用 ConsumeParry() 来查询并消费弹反机会。
|
||||
/// </summary>
|
||||
public class ParrySystem : MonoBehaviour
|
||||
{
|
||||
/// <summary>当前是否处于弹反激活窗口。Phase 2 由输入/动画事件写入。</summary>
|
||||
public bool IsParrying { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询并消费一次弹反机会。
|
||||
/// 若处于弹反窗口则返回 true 并关闭窗口;否则返回 false。
|
||||
/// </summary>
|
||||
public bool ConsumeParry()
|
||||
{
|
||||
if (!IsParrying) return false;
|
||||
IsParrying = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Phase 2:由动画事件 / InputReader 调用以开启弹反窗口
|
||||
public void OpenParryWindow() => IsParrying = true;
|
||||
public void CloseParryWindow() => IsParrying = false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user