想问下怎么用unity开发kinect拍照片,因为要拍照片,必须要先调用摄像头,但是由于Kinect自带的摄像头分辨率比较低,拍出来的照片很不理想,所以想换一个高清一点的摄像头,要怎么写呢?

下面是我不用kinect,单独调用外部摄像头的方法:

  1. public string deviceName;
  2.     WebCamTexture tex;
  3.     // Use this for initialization
  4.     IEnumerator Start()
  5.     {
  6.         //获取授权
  7.         yield return Application.RequestUserAuthorization(UserAuthorization.WebCam);
  8.         if (Application.HasUserAuthorization(UserAuthorization.WebCam))
  9.         {
  10.             WebCamDevice[] devices = WebCamTexture.devices;
  11.    print(devices.Length);
  12.             deviceName = devices[0].name;
  13.             tex = new WebCamTexture(deviceName, 1400, 900, 12);
  14.             renderer.material.mainTexture = tex;
  15.             tex.Play();
  16.         }
  17.         else
  18.         {
  19.         }
  20.     } 
 
 
用了上面那个调用外部摄像头的代码后,kinect的摄像头就不好用了;一直报“Could not start graph
UnityEngine.WebCamTexture:Play()
<Start>c__Iterator2:MoveNext() (at Assets/ZigFu/Scripts/Viewers/ZigToVM.cs:20)


Could not pause pControl
UnityEngine.WebCamTexture:Play()
<Start>c__Iterator2:MoveNext() (at Assets/ZigFu/Scripts/Viewers/ZigToVM.cs:20)

”错误,不知道是什么原因,哪位大神知道?