unity-获取安卓权限

string[] strs = new string[] { "android.permission.WRITE_EXTERNAL_STORAGE" //"android.permission.READ_EXTERNAL_STORAGE" //"android.permission.INTERNET", //"android.permission.READ_PHONE_STATE", //"android.permission.READ_EXTERNAL_STORAGE", //"android.permission.WRITE_EXTERNAL_STORAGE", //"android.permission.ACCESS_WIFI_STATE", //"android.permission.ACCESS_NETWORK_STATE", //"android.permission.GET_TASKS", //"android.permission.REQUEST_INSTALL_PACKAGES", //"android.permission.WAKE_LOCK", //"android.permission.SYSTEM_ALERT_WINDOW", //"android.permission.CHANGE_WIFI_STATE", //"android.permission.CHANGE_NETWORK_STATE", //"android.permission.ACCESS_COARSE_LOCATION", //"android.permission.ACCESS_FINE_LOCATION", //"android.permission.SYSTEM_OVERLAY_WINDOW", //"android.permission.ACCESS_COARSE_UPDATES", //"android.permission.WRITE_SETTINGS", //"android.permission.BATTERY_STATS", //"android.permission.MOUNT_UNMOUNT_FILESYSTEMS" };


public void test4() { strs.ToList().ForEach(s => { if (!Permission.HasUserAuthorizedPermission(s)) { Permission.RequestUserPermission(s); } else { Debug.Log("it has RequestUserPermission: " + s); } }); }

你可能感兴趣的:(unity-获取安卓权限)