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();
}
Cannot use web cam, since the user has not authorized this
最新推荐文章于 2023-02-08 15:59:36 发布