zoukankan      html  css  js  c++  java
  • Unity调用手机摄像头进行摄像,并显示

    核心知识:
    WebCamTexture(网络摄像头材质)
    关键方法:
    WebCamTexture.Play()播放;WebCamTexture.Pause()暂停;WebCamTexture.Stop()停止;
    例1:

    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, 40030012);  

        webCamShow.mainTexture=tex;

            tex.Play();

        }  

    }

  • 相关阅读:
    SHELL[22]
    SHELL[15]
    SHELL[08]
    SHELL[12]
    SHELL[06]
    SHELL[24]
    SHELL[11]
    shell文件合并、去重
    SHELL[25]
    SHELL[14]
  • 原文地址:https://www.cnblogs.com/kuangwu/p/2954282.html
Copyright © 2011-2022 走看看