Snapshot.cs 847 B

1234567891011121314151617181920
  1. // Snapshot interface so we can reuse it for all kinds of systems.
  2. // for example, NetworkTransform, NetworkRigidbody, CharacterController etc.
  3. // NOTE: we use '<T>' and 'where T : Snapshot' to avoid boxing.
  4. // List<Snapshot> would cause allocations through boxing.
  5. namespace Mirror
  6. {
  7. public interface Snapshot
  8. {
  9. // snapshots have two timestamps:
  10. // -> the remote timestamp (when it was sent by the remote)
  11. // used to interpolate.
  12. // -> the local timestamp (when we received it)
  13. // used to know if the first two snapshots are old enough to start.
  14. //
  15. // IMPORTANT: the timestamp does _NOT_ need to be sent over the
  16. // network. simply get it from batching.
  17. double remoteTimestamp { get; set; }
  18. double localTimestamp { get; set; }
  19. }
  20. }