private void SendSnapshot()
 {
     _snapshotMessage = new SnapshotMessage(_playerCubes, _littleCubes);
     foreach (var connection in _connectedPlayers)
     {
         if (!Input.GetKey(KeyCode.Space))
         {
             NetworkServer.SendToObservers(connection, _snapshotMessage, 1); // 1 is unreliable
         }
     }
 }
Ejemplo n.º 2
0
        public SnapshotMessage Copy()
        {
            SnapshotMessage message = new SnapshotMessage();

            message.SequenceNumber      = SequenceNumber;
            message.NumberOfPlayers     = NumberOfPlayers;
            message.NumberOfLittleCubes = NumberOfLittleCubes;
            message.Positions           = Positions;
            message.Rotations           = Rotations;
            return(message);
        }
Ejemplo n.º 3
0
 public InterpolationData(float time, SnapshotMessage snapshot)
 {
     Time     = time;
     Snapshot = snapshot;
 }