Ejemplo n.º 1
0
 private void GrantPermission(PermissionPlease.AndroidPermission permission)
 {
     #if UNITY_ANDROID
     print("grantingPermission");
     PermissionPlease.GrantPermission(permission, OnPermissionCallback, true);
     #else
     // handle other device's permissions here, iOS for example
     #endif
 }
    // Use this for initialization
    void Start()
    {
        foreach (PermissionPlease.AndroidPermission value in Enum.GetValues(typeof(PermissionPlease.AndroidPermission)))
        {
            PermissionPlease.AndroidPermission permision = value;

            Button button = Instantiate(baseButton, content);
            button.GetComponentInChildren <Text>().text = permision.ToString();
            button.onClick.AddListener(() => PermissionPlease.GrantPermission(permision, null, true));
            button.gameObject.SetActive(true);
        }
    }