Cannot use web cam, since the user has not authorized this

来源:互联网 发布:赵薇被处罚知乎 编辑:程序博客网 时间:2024/06/06 07:06
Cannot use web cam, since the user has not authorized this!UnityEngine.WebCamTexture:Play()Application.RequestUserAuthorization(UserAuthorization.WebCam);if(Application.HasUserAuthorization(UserAuthorization.WebCam)) Debug.Log("Authorized");public string deviceName;WebCamTexture tex;Application.RequestUserAuthorization(UserAuthorization.WebCam);if (Application.HasUserAuthorization(UserAuthorization.WebCam)){  WebCamDevice[] devices = WebCamTexture.devices;  deviceName = devices[0].name;  tex = new WebCamTexture(deviceName, 400, 300, 12);  renderer.material.mainTexture = tex;  tex.Play();}