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();

        }  

    }

  • 相关阅读:
    Server Profiler
    Unit Test with VS.NET
    js解析json字符
    多维数组
    $routeProvider与$stateProvider区别
    post 与get
    gulp配置
    homebrew常用指令
    less.js
    过滤器
  • 原文地址:https://www.cnblogs.com/kuangwu/p/2954282.html
Copyright © 2011-2022 走看看