对静态方法进行BurstCompile
需要导入Burst Package
添加命名空间相关引用
```csharp
using Unity.Burst;
using AOT;
[BurstCompile]
public class TT
{
[BurstCompile(CompileSynchronously=true)]
[MonoPInvokeCallback(typeof(Process2FloatsDelegate))]
public static float Cal(float a,float b)
{
return (a-b)/(a + b) ;
}
public delegate float Process2FloatsDelegate(float a,float b);
public readonly static Process2FloatsDelegate mulFunctionPointerInvoke = BurstCompiler.CompileFunctionPointer<Process2FloatsDelegate>(Cal).Invoke;
}
调用
var resultMul = TT.mulFunctionPointerInvoke(3.0f, 4.0f);
print(resultMul);