bool ReadUpdatePacket(byte[] packet, out PacketHeader header, out int avatarCount, ref AvatarStateQuantized[] avatars, out int cubeCount, ref int[] cubeIds, ref bool[] notChanged, ref bool[] hasDelta, ref bool[] hasPerfectPrediction, ref bool[] hasPredictionDelta, ref ushort[] baselineIds, ref CubeState[] cubes, ref CubeDelta[] deltas, ref CubeDelta[] predictions ) { Profiler.BeginSample("ReadStateUpdatePacket"); stream.Start(packet); var result = true; try { serializer.ReadUpdatePacket(stream, out header, out avatarCount, avatars, out cubeCount, cubeIds, notChanged, hasDelta, hasPerfectPrediction, hasPredictionDelta, baselineIds, cubes, deltas, predictions); } catch (SerializeException) { Debug.Log("error: failed to read state update packet"); header.id = 0; header.ack = 0; header.ackBits = 0; header.frame = 0; header.resetId = 0; header.timeOffset = 0.0f; avatarCount = 0; cubeCount = 0; result = false; } stream.Finish(); Profiler.EndSample(); return(result); }