|
Hi, I'm trying to use Marshal.StructureToPtr to convert a structure before sending via a socket to another app. It works in the editor, but crashes on the Marshal.StructureToPtr call in the webplayer. Heres some example code: [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct SENDPOS { public long SendId; public float x,y,z; };
//(in Start() )
//in Update()
Is marshaling supposed to work in the webplayer, or is this a Unity bug? Or am I doing something wrong in the above code?
(comments are locked)
|
|
Regardless of whether this should be enabled or not, crashing the browser is always a bug. Please report it using the bug reporter :) Yep, had filed a bug report already. Seems like it's not supposed to be supported (as that would be unmanaged memory), but the current webplayer just crashes if you try to use it. The best workaround I've found so far is to use Buffer.BlockCopy and BitConverter.GetBytes to convert variables into a block of memory.
Dec 23 '10 at 04:45 PM
Chris 20
(comments are locked)
|
