| 12345678910111213141516171819202122232425262728293031323334 |
- #if UNITY_EDITOR
- using System;
- using System.Runtime.InteropServices;
- public static class NativeAppInfo
- {
- #if UNITY_IOS && !UNITY_EDITOR
- private static IntPtr AppRuntimes_GetTestUserID() => NativeApi.AppInfo.AppRuntimes_GetTestUserID();
- private static int AppRuntimes_GetEnableUnityLog() => NativeApi.AppInfo.AppRuntimes_GetEnableUnityLog();
- private static void AppRuntimes_FreeString(IntPtr value) => NativeApi.AppInfo.AppRuntimes_FreeString(value);
- #endif
- public static bool GetEnableUnityLog()
- {
- #if UNITY_IOS && !UNITY_EDITOR
- return AppRuntimes_GetEnableUnityLog() != 0;
- #else
- return false;
- #endif
- }
- public static string GetTestUrl()
- {
- #if UNITY_IOS && !UNITY_EDITOR
- var value = AppRuntimes_GetTestUserID();
- if (value == IntPtr.Zero) return string.Empty;
- try { return Marshal.PtrToStringAnsi(value) ?? string.Empty; }
- finally { AppRuntimes_FreeString(value); }
- #else
- return string.Empty;
- #endif
- }
- }
- #endif
|