Limitations around Marshaling

Hello there, I’m developing an online game client which has to trade packets with a C++ server.

For each packet I write the corresponding structure in the C# code using the System.Runtime.InteropServices.Marshal class to work with unmanaged/managed types situation.

I read somewhere that Unity doesn’t allow use of unsafe code on some platforms such as the WebPlayer. I started using pointers and fixed size buffers in the structures just because the fastest way to handle these type conversions is by using pointer type cast. When I read about this Unity limitation of using unsafe code I changed the whole core of the code and implemented the Marshal-based structures.

The problem is that I just read that this limitation is extended to PInvoke. I didn’t find nothing relating this limitation for the Marshal class itself, but as Marshal is very related with PInvoke I’m seriously concerned about this once my game will build to web player too.

So, the question is: should I worry about this limitation (or any other) because the use of Marshal class?

Thanks.

Up =[