fixes
This commit is contained in:
@@ -67,8 +67,8 @@ public class PlayerInput2 : IPlayerInput
|
||||
_recordState.ViewDelta += new Float2(Input.GetAxisRaw("Mouse X"), Input.GetAxisRaw("Mouse Y")) * sensitivity;
|
||||
_recordState.ViewDelta += new Float2(Input.GetAxisRaw("LookRight"), Input.GetAxisRaw("LookUp")) * Time.DeltaTime * turnSpeed;
|
||||
|
||||
_recordState.MoveForward = Math.Max(_recordState.MoveForward, Input.GetAxis("Vertical"));
|
||||
_recordState.MoveRight = Math.Max(_recordState.MoveRight, Input.GetAxis("Horizontal"));
|
||||
_recordState.MoveForward = MathF.MaxMagnitude(_recordState.MoveForward, Input.GetAxis("Vertical"));
|
||||
_recordState.MoveRight = MathF.MaxMagnitude(_recordState.MoveRight, Input.GetAxis("Horizontal"));
|
||||
_recordState.Attack |= Input.GetAction("Attack");
|
||||
_recordState.Jump |= Input.GetAction("Jump");
|
||||
}
|
||||
@@ -80,8 +80,28 @@ public class PlayerInput2 : IPlayerInput
|
||||
|
||||
public class PlayerInputNetwork2 : IPlayerInput
|
||||
{
|
||||
public void SetFrame(ulong frame) { }
|
||||
public void UpdateState() { }
|
||||
private uint _playerId;
|
||||
private WorldStateManager _worldStateManager;
|
||||
private ulong _frame;
|
||||
private PlayerInputState2 _state;
|
||||
|
||||
public PlayerInputNetwork2(uint playerId, WorldStateManager worldStateManager)
|
||||
{
|
||||
_playerId = playerId;
|
||||
_worldStateManager = worldStateManager;
|
||||
}
|
||||
|
||||
public void SetFrame(ulong frame) => _frame = frame;
|
||||
|
||||
public void UpdateState()
|
||||
{
|
||||
_worldStateManager.GetPlayerInputState(_playerId, _frame, out _state);
|
||||
}
|
||||
|
||||
public PlayerInputState2 GetState() { return default; }
|
||||
public void ResetState() { }
|
||||
|
||||
public void ResetState()
|
||||
{
|
||||
_state = new PlayerInputState2();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user