36 lines
763 B
C#
36 lines
763 B
C#
using System.Runtime.InteropServices;
|
|
using UnityEngine;
|
|
|
|
namespace Kunpo.Privacy
|
|
{
|
|
public class SystemTools
|
|
{
|
|
//打开应用设置
|
|
public static void OpenAppSetting()
|
|
{
|
|
#if UNITY_EDITOR
|
|
#elif UNITY_IOS
|
|
__OpenSystemSetting();
|
|
#elif UNITY_ANDROID
|
|
using (var javaUnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
|
{
|
|
using (var currentActivity = javaUnityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
|
|
{
|
|
using (var androidPlugin = new AndroidJavaClass("com.shaoxia.unitytools.NativeTools"))
|
|
{
|
|
androidPlugin.CallStatic("OpenSystemSetting", currentActivity);
|
|
}
|
|
}
|
|
}
|
|
#endif
|
|
}
|
|
|
|
#if UNITY_IOS
|
|
[DllImport("__Internal")]
|
|
public static extern void __OpenSystemSetting();
|
|
#endif
|
|
}
|
|
}
|
|
|
|
|