Unity IL2Cpp throw System.NotImplementedException
ZhanPeng opened this issue · comments
I use SharpDX.DirectInput in Unity. Today, I need IL2Cpp Project. but IL2Cpp say
IL2CPP error for method 'System.Void SharpDX.Utilities::Read(System.IntPtr,T&)' in assembly 'C:\Workspace\Unity\aicfve-previz\PrevizUnityEditor\Temp\StagingArea\Data\Managed\SharpDX.dll'
Additional information: Build a development build for more information. NotImplementedException
Next, I check SharpDX source code
public unsafe static void Read<T>(IntPtr source, ref T data) where T : struct
{
data = *(T*)(void*)source;
}
In the first time , I want remove this code, but when I check using .the bad thing for me.
Usages Of 'Read<T>(...)'
Get<T>(int):T (in SharpDX.DataBuffer)
GetDataAs<T>():T (in SharpDX.Multimedia.RiffChunk)
GetCurrentState(ref T):void (in SharpDX.DirectInput.CustomDevice)
SharpDX class used Read function.
public unsafe void GetCurrentState(ref T data)
{
int num = Utilities.SizeOf<TRaw>();
byte* numPtr = stackalloc byte[num * 2];
TRaw data1 = default (TRaw);
this.GetDeviceState(num, (IntPtr) ((void*) numPtr));
// here!!!
Utilities.Read<TRaw>((IntPtr) ((void*) numPtr), ref data1);
data.MarshalFrom(ref data1);
}
how I solve problem. Thank you.
@xoofx you have any ideas?
how I solve problem. Thank you.
It is a problem with IL2CPP, you have to contact Unity IL2CPP and send a bug to them (via the forum)