Does Unity3D support unsafe codes in C#?
no, communication to the unmanaged dlls / bundle in Unity Pro is restricted to the InteropServices, DllImport and Marshaling
Ok. Thanks, dreamora.
So we can’t use unsafe in C# script in Unity, but can we use a dll which is compiled with /unsafe and so containing unsafe code ? (Actualy I’m developping a such dll and Unity randomly crashes with :
Récipient d’erreurs , type 0
Nom d’événement*: APPCRASH
Réponse*: Non disponible
ID de CAB : 0
Signature du problème :
P1 : Unity.exe
P2 : 3.3.0.63049
P3 : 4d6cfa24
P4 : Unity.exe
P5 : 3.3.0.63049
P6 : 4d6cfa24
P7 : c0000005
P8 : 00503a83
If this is the “unsafe” problem, making a wrapper-like dll could be a good issue or not ? Ty by advance ;o)
Hi, Eclectyc
I’m doing similar work to you. So can you create such dll and used by Unity?
No. Unsafe code is disabled in our mono runtime. Marshalling, interloop and dllimport is what you have available.
Ah and obviously binary code is not supported in the webplayer.
Thanks, AngryAnt.
Now, I can trim the solution using unsafe code…