Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

293
Vistas
How to ask runtime permissions for Camera in unity?

I need a C# script, in case the user refuses permission, a message appears that he must go to the settings in order to allow the permission the overloaded image here enter image description here

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

If you try searching a bit on the Google or in Unity Docs, you'll find Requesting Permissions article. I would suggest you to go through the complete documentation to get the better idea.

However, to make things easy, you can refer to below code:

using UnityEngine;
#if UNITY_ANDROID
using UnityEngine.Android;
#endif

void CheckCameraPermission()
{
    #if UNITY_IOS
        if (!Permission.HasUserAuthorizedPermission(Permission.Camera)) {
            // PERMISSION NOT AVAILABLE ON IOS, DISPLAY POPUP MESSAGE
        }
    #endif
    #if UNITY_ANDROID
        if (!Permission.HasUserAuthorizedPermission(Permission.Camera)) {
            // PERMISSION NOT AVAILABLE ON ANDROID, DISPLAY POPUP MESSAGE
        }
    #endif
}

I hope that answers your question.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda