Hey Jan! NPatch from MSDN forums here.
Thing is, I'm in touch with Unity for trying the regular .NET assemblies on Unity 2017.2 with the experimental .NET4.6 profile. And in researching this, I found out that the .NET assembly being loaded in .NET projects is a reference assembly(meaning no code, this only references the true assembly) and the ultimately referenced assembly that contains all the code is the one in the GAC which is a mixed mode C++/CLI assembly. I learnt that using ILSpy on them. But ILSpy can also decompile assemblies and when I tried to decomplile the mixed mode one, I found out :
..
using ;
using System;
using System.Collections.Generic;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
private readonly NativeReaderWriterLock _cachedObjectLock = new NativeReaderWriterLock();
private Dictionary<JointType, Joint> _joints;
private Dictionary<JointType, JointOrientation> _orientations;
private Dictionary<Expression, DetectionResult> _expressions;
private Dictionary<Activity, DetectionResult> _activities;
private Dictionary<Appearance, DetectionResult> _appearance;
internal unsafe IBody* NativeBody
{
get
{
return this._pNativeBody;
}
}
public unsafe TrackingState LeanTrackingState
{
get
{
TrackingState result = TrackingState.NotTracked;
IBody* pNativeBody = this._pNativeBody;
KinectExceptionHelper.CheckHr(calli(System.Int32 modopt(System.Runtime.CompilerServices.IsLong) modopt(System.Runtime.CompilerServices.CallConvStdcall)(System.IntPtr,_TrackingState*), pNativeBody, ref result, *(*(int*)pNativeBody + 72)));
return result;
}
}
public unsafe PointF Lean
{
get
{
PointF result = default(PointF);
IBody* pNativeBody = this._pNativeBody;
KinectExceptionHelper.CheckHr(calli(System.Int32 modopt(System.Runtime.CompilerServices.IsLong) modopt(System.Runtime.CompilerServices.CallConvStdcall)(System.IntPtr,_PointF*), pNativeBody, ref result, *(*(int*)pNativeBody + 68)));
return result;
}
}
..
If you try it yourself you can get the full files and cross reference the offsets they have, seeing as they are hardcoded.