_net prog
This commit is contained in:
@@ -11,7 +11,7 @@ namespace Game;
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PlayerInputState2
|
||||
{
|
||||
//public ulong frame;
|
||||
public ulong Frame;
|
||||
public Float2 ViewDelta;
|
||||
public float MoveForward;
|
||||
public float MoveRight;
|
||||
@@ -53,8 +53,13 @@ public class PlayerInput2 : IPlayerInput
|
||||
[ConsoleVariable("sensitivity")]
|
||||
private static float _sensitivity { get; set; } = 1.0f;
|
||||
|
||||
private ulong _frame;
|
||||
|
||||
public void SetFrame(ulong frame)
|
||||
{
|
||||
if (_frame != frame)
|
||||
ResetState();
|
||||
_frame = frame;
|
||||
}
|
||||
|
||||
public void UpdateState()
|
||||
@@ -74,6 +79,7 @@ public class PlayerInput2 : IPlayerInput
|
||||
_recordState.MoveRight = MathF.MaxMagnitude(_recordState.MoveRight, Input.GetAxis("Horizontal"));
|
||||
_recordState.Attack |= Input.GetAction("Attack");
|
||||
_recordState.Jump |= Input.GetAction("Jump");
|
||||
_recordState.Frame = _frame;
|
||||
}
|
||||
|
||||
public PlayerInputState2 GetState() => _recordState;
|
||||
|
||||
Reference in New Issue
Block a user