public static unsafe void RegisterMapCreationHook(MapCreatedCallback callback, void *refcon) { IL.DeclareLocals(false); IntPtr callbackPtr = callback != null?Marshal.GetFunctionPointerForDelegate(callback) : default; RegisterMapCreationHookPrivate(callbackPtr, refcon); GC.KeepAlive(callback); }
static unsafe Map() { var userInterfaceUtf8 = new byte[UserInterface.Length + 1]; Utf8.FromUtf16(UserInterface, userInterfaceUtf8, out _, out _); UserInterfaceUtf8 = userInterfaceUtf8; var instructorOperatorStationUtf8 = new byte[InstructorOperatorStationUtf8.Length + 1]; Utf8.FromUtf16(InstructorOperatorStation, instructorOperatorStationUtf8, out _, out _); InstructorOperatorStationUtf8 = instructorOperatorStationUtf8; _mapCreatedCallback = OnMapCreated;