PermissionRequest.cs 483 B

12345678910111213141516171819202122
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.Android;
  5. public class PermissionRequest : MonoBehaviour
  6. {
  7. string[] permissionList ={
  8. Permission.ExternalStorageRead,
  9. Permission.ExternalStorageWrite,
  10. Permission.Camera
  11. };
  12. void Awake() {
  13. if(permissionList.Length > 0) {
  14. AndroidPluginPermission.getInstant.RequestPermission(permissionList);
  15. }
  16. }
  17. }