Unity 4.6.8f1
XCode 6.3.1
Mac 10.10.5
Visual Studio 2013
Hi,
I wrote a script like this, compile it to a DLL file and use it in Unity.
public class Class1 : MonoBehaviour
{
public delegate void OnBroadCast(int data);
public event OnBroadCast AAA;
public void OnBroadCastMsg(int data)
{
}
void Awake()
{
AAA += OnBroadCastMsg;
}
}
I put the DLL file into a Unity Project, and attach it on a GameObject. Build the project to an iOS project, open the XCode and load it. But when I run it one a device, it report the error and crash:
Unhandled Exception: System.ExecutionEngineException: Attempting to JIT compile method ‘(wrapper managed-to-native) System.Threading.Interlocked:CompareExchange (Class1/OnBroadCast&,Class1/OnBroadCast,Class1/OnBroadCast)’ while running with --aot-only.
at Class1.add_AAA (.OnBroadCast value) [0x00000] in :0
at Class1.Awake () [0x00000] in :0
But if I just use the C# file script and run it on iOS device, it is has no Error.
I don’t know why the DLL file can’t work, Please help!