Why can't I use a byte with PhotonStream.Serialize?

Options
Hello!

I'm trying to lessen the network traffic in my game. One of the things I'd like to do is send over bytes instead of ints to use up 1 byte instead of 4.

But I cannot do PhotonStream.Serialize(ref byte b);

Any way around this? Thanks :)

Comments

  • Tobias
    Options
    In PUN 2, we serialize small integers into less bytes. So you can use int in many cases without impact.
    I guess it's missing, because we're using byte-arrays in other places and with those, you don't have to "serialize" a byte, you just set it.
    As a workaround, please add the missing method. It's technically allowed to have a byte in said stream.

    Aside from that, you can be even more effective at saving data by writing your own, optimized byte-array. If that's something you wanted to go for, it's definitely an option.