RequestPermission.cs 346 B

1234567891011121314
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.Android;
  4. namespace Rokid.UXR.Utility {
  5. public class RequestPermission : MonoBehaviour
  6. {
  7. private void Awake()
  8. {
  9. if (!Permission.HasUserAuthorizedPermission("android.permission.CAMERA"))
  10. Permission.RequestUserPermission("android.permission.CAMERA");
  11. }
  12. }
  13. }