- Home /
Unity 4.6.3 RPC doesn't supports System.byte
Hello. I faced an issue when updated to unity 4.6.3 - for now it can't send byte[] types via RPC. I have a huge piece of code based on this ability, so it would be nice if someone could help with alternative solution. I could send int[] params instead, but they are supposed to be a little bit "heavier", isn't it? Does Unity has some kind of compression on it?
Thanx.
P.S. Obviously, i can just stay on older versions of unity, but it would be better to have a solution.
Answer by Owen-Reynolds · Feb 22, 2015 at 03:33 PM
Moving bytes in and out of ints and chars is a common computer trick. I assume there's no longer (was there?) an RPC byte parm type since "everyone" knows you don't need it. Search for things like "C# bytes into int" (or char.) This one seems fine:
http://stackoverflow.com/questions/6406324/how-can-i-combine-4-bytes-into-a-32-bit-unsigned-integer