/// <summary>
 /// Read the current scene ID from the bitstream. Return -1 for Scene not being in the build list, or if includeSceneIndexInUpdate is disabled.
 /// </summary>
 /// <param name="bitstream"></param>
 /// <param name="outstream"></param>
 /// <param name="asServer"></param>
 /// <returns></returns>
 public static int Deserialize(ref UdpBitStream bitstream, ref UdpBitStream outstream, bool asServer)
 {
     if (includeSceneIndexInUpdates)
     {
         int buildindex = bitstream.ReadInt(bitsForSceneIndex);
         if (asServer)
         {
             outstream.Write(buildindex, bitsForSceneIndex);
         }
         return(buildindex);
     }
     else
     {
         return(-1);
     }
 }