hejianchun

今天运气好,被我看见了在unity 3d中如何调用手机摄像头的问题了,记录下来,为以后留着用

 

public  WebCamTexture   webCamTexture;
public   Material     webCamMaterial;
IEnumerator   webCam(){
yield return Application.RequestUserAuthorization(UserAuthorization.WebCam);
    if (Application.HasUserAuthorization(UserAuthorization.WebCam))  
    {  
        WebCamDevice[] devices = WebCamTexture.devices;  
        deviceName = devices[0].name;  
 
    tex= new WebCamTexture(deviceName, 400, 300, 12);  
    webCamShow.mainTexture=tex;
        tex.Play();
    }  
}

WebCamTexture.Play()播放;

WebCamTexture.Pause()暂停;

WebCamTexture.Stop()停止

分类:

技术点:

相关文章:

  • 2021-11-23
  • 2021-11-23
  • 2021-11-23
  • 2021-11-14
  • 2021-11-23
  • 2021-11-04
  • 2021-10-27
  • 2021-11-14
猜你喜欢
  • 2021-11-14
  • 2021-11-04
  • 2021-04-12
  • 2021-09-23
  • 2021-11-14
  • 2021-10-17
相关资源
相似解决方案