private void LogKeyPress(PlayerInputType inputType, bool pressedDown) { var inputEntry = new PlayerInputEntry { InputType = inputType, TimeOffset = GameManager.Instance.GetTimeSinceLevelStart(), WasPressedDown = pressedDown }; _playerInputs.Add(inputEntry); }
public void ApplyInput(PlayerInputEntry replay) { var pressed = replay.WasPressedDown; switch (replay.InputType) { case PlayerInputType.Left: _left = pressed; break; case PlayerInputType.Right: _right = pressed; break; case PlayerInputType.Dash: _dash = pressed; break; default: throw new Exception("Somehow tried to process an input type which doesn't even exist, dude"); } }