2017-03-10 58 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();