20 lines
957 B
C#
20 lines
957 B
C#
using Unity.Entities;
|
|
using Unity.NetCode;
|
|
|
|
namespace ProjectM.Simulation
|
|
{
|
|
/// <summary>
|
|
/// MC-1 — predicted per-player dash cooldown gate (an <c>AbilityCooldown</c> twin). <c>[GhostField]</c> so the
|
|
/// owning client does not mispredict the cooldown across rollback / reconnect: re-predicted ticks see the same
|
|
/// authoritative gate the server applied and converge without a double-dash. <c>0</c> = ready; set to
|
|
/// <c>serverTick + dashCooldownTicks</c> via <c>TickUtil.NonZero</c> on dash-start; compare by wrapping into a
|
|
/// <see cref="NetworkTick"/> and using <see cref="NetworkTick.IsNewerThan"/> (raw uint subtraction is unsafe
|
|
/// across tick wraparound). Baked <c>{NextTick = 0}</c>.
|
|
/// </summary>
|
|
public struct DashCooldown : IComponentData
|
|
{
|
|
/// <summary>Raw tick of the earliest tick the player may dash again. <c>0</c> = ready.</summary>
|
|
[GhostField] public uint NextTick;
|
|
}
|
|
}
|