NativeApi.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Runtime.InteropServices;
  3. public static class NativeApi
  4. {
  5. public delegate void DialogCallback(int result);
  6. #if UNITY_IOS && !UNITY_EDITOR
  7. public static class AppInfo
  8. {
  9. [DllImport("__Internal")]
  10. public static extern IntPtr AppRuntimes_GetTestUserID();
  11. [DllImport("__Internal")]
  12. public static extern int AppRuntimes_GetEnableUnityLog();
  13. [DllImport("__Internal")]
  14. public static extern void AppRuntimes_FreeString(IntPtr value);
  15. }
  16. public static class TimeZone
  17. {
  18. [DllImport("__Internal")]
  19. public static extern IntPtr IOS_GetLocalTimeZoneId();
  20. [DllImport("__Internal")]
  21. public static extern void IOS_FreeCString(IntPtr pointer);
  22. }
  23. public static class Dialog
  24. {
  25. [DllImport("__Internal")]
  26. public static extern void AppRuntimes_ShowDialog(string message, DialogCallback callback);
  27. [DllImport("__Internal")]
  28. public static extern void AppRuntimes_ShowRetryDialog(string message, DialogCallback callback);
  29. }
  30. #endif
  31. }