Files
vampire-like/Assets/GameMain/Scripts/Base/Event/Player/PlayerHealthChangeEventArgs.cs
T
SepComet affa44e4d0 调整 Event 和 Editor 命名空间
- 将原来的 CustomEvent 调整到 SepCore.Event
- 将 Editor 文件夹下的统一到 SepCore.Editor,顺带修改了 Editor 程序集
2026-06-02 19:26:21 +08:00

42 lines
1.1 KiB
C#

using GameFramework;
using GameFramework.Event;
namespace SepCore.Event
{
public class PlayerHealthChangeEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(PlayerHealthChangeEventArgs).GetHashCode();
public override int Id => EventId;
public int Damage { get; private set; }
public int CurrentHealth { get; private set; }
public int MaxHealth { get; private set; }
public PlayerHealthChangeEventArgs()
{
Damage = 0;
CurrentHealth = 0;
MaxHealth = 0;
}
public static PlayerHealthChangeEventArgs Create(int damage, int currentHealth, int maxHealth)
{
var args = ReferencePool.Acquire<PlayerHealthChangeEventArgs>();
args.Damage = damage;
args.CurrentHealth = currentHealth;
args.MaxHealth = maxHealth;
return args;
}
public override void Clear()
{
Damage = 0;
CurrentHealth = 0;
MaxHealth = 0;
}
}
}