Beispiel #1
0
 public static bool checkPermissions()
 {
     if (Application.platform != RuntimePlatform.Android)
     {
         return(true);
     }
     return(CameraPermissionsController.IsPermissionGranted(CAMERA_PERMISSION));
 }
Beispiel #2
0
    // Start is called before the first frame update
    void Start()
    {
        bool granted = CameraPermissionsController.IsPermissionGranted(CAMERA_ACCESS_PERMISSION);

        if (!granted)
        {
            RequestCameraPermission();
        }
    }
Beispiel #3
0
 private void RequestCameraPermission()
 {
     CameraPermissionsController.RequestPermission(new[] { EasyWebCam.CAMERA_PERMISSION }, new AndroidPermissionCallback(
                                                       grantedPermission =>
     {
         // The permission was successfully granted, restart the change avatar routine
     },
                                                       deniedPermission =>
     {
         // The permission was denied
     },
                                                       deniedPermissionAndDontAskAgain =>
     {
         // The permission was denied, and the user has selected "Don't ask again"
         // Show in-game pop-up message stating that the user can change permissions in Android Application Settings
         // if he changes his mind (also required by Google Featuring program)
     }));
 }