LagCompensationSettings.cs 809 B

12345678910111213141516171819
  1. // snapshot interpolation settings struct.
  2. // can easily be exposed in Unity inspectors.
  3. using System;
  4. using UnityEngine;
  5. namespace Mirror
  6. {
  7. // class so we can define defaults easily
  8. [Serializable]
  9. public class LagCompensationSettings
  10. {
  11. [Header("Buffering")]
  12. [Tooltip("Keep this many past snapshots in the buffer. The larger this is, the further we can rewind into the past.\nMaximum rewind time := historyAmount * captureInterval")]
  13. public int historyLimit = 6;
  14. [Tooltip("Capture state every 'captureInterval' seconds. Larger values will space out the captures more, which gives a longer history but with possible gaps inbetween.\nSmaller values will have fewer gaps, with shorter history.")]
  15. public float captureInterval = 0.100f; // 100 ms
  16. }
  17. }