No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

OverloadedFunctionPointers.cs 477B

1234567891011121314151617
  1. namespace OverloadedFunctionPointers
  2. {
  3. #if UNITY_2021_2_OR_NEWER && UNITY_EDITOR
  4. public unsafe struct Callable
  5. {
  6. public int Value;
  7. private Callable(int x)
  8. {
  9. Value = x;
  10. }
  11. public static Callable Create<T1, T2>(delegate* unmanaged[Cdecl] < T1, T2, void > function) => new Callable(2);
  12. public static Callable Create<T1, TRet>(delegate* unmanaged[Cdecl] < T1, TRet > function) => new Callable(3);
  13. }
  14. #endif
  15. }