2017-03-10 66 views

回答

0

您需要创建一个网络摄像头纹理并播放它,然后您可以创建一个纹理2D和getpixels的网络摄像头纹理来获得您的颜色。

WebCamTexture cam; 

// Open the Camera on the desired device/pc cam 
    cam = new WebCamTexture(); 
    cam.Play(); 
    currentTexture =new Texture2D(cam.width, cam.height, TextureFormat.RGB24, false); 

拿到像素摄像头,你可以这样做

 cam.GetPixels();