Assets \ Wikitude \ Samples \ Scripts \ MenuController.cs(26,46):错误CS0103:名称'Permission'在当前上下文中不存在
#if UNITY_2018_3_OR_NEWER && UNITY_ANDROID
if (!Permission.HasUserAuthorizedPermission(Permission.Camera)) {
Permission.RequestUserPermission(Permission.Camera);
}
答案 0 :(得分:0)
Permission
在UnityEngine.Android
命名空间中,因此,如果要简单地将其引用为using UnityEngine.Android
,则需要在脚本中包含Permission
:
using UnityEngine;
using UnityEngine.Android;
...
#if UNITY_2018_3_OR_NEWER && UNITY_ANDROID
if (!Permission.HasUserAuthorizedPermission(Permission.Camera)) {
Permission.RequestUserPermission(Permission.Camera);
}