コード例 #1
0
 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
         }
     }
 }
コード例 #2
0
ファイル: SnapshotMessage.cs プロジェクト: Yayap13/Bachelor
        public SnapshotMessage Copy()
        {
            SnapshotMessage message = new SnapshotMessage();

            message.SequenceNumber      = SequenceNumber;
            message.NumberOfPlayers     = NumberOfPlayers;
            message.NumberOfLittleCubes = NumberOfLittleCubes;
            message.Positions           = Positions;
            message.Rotations           = Rotations;
            return(message);
        }
コード例 #3
0
ファイル: InterpolationData.cs プロジェクト: Yayap13/Bachelor
 public InterpolationData(float time, SnapshotMessage snapshot)
 {
     Time     = time;
     Snapshot = snapshot;
 }