• 大小: 17.17M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-19
  • 语言: 其他
  • 标签: 其他  

资源简介

NetCameraTest5.4.zip

资源截图

代码片段和文件信息

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class HttpWebCam : MonoBehaviour
{

    public string uri;
    public string username;
    public string password;

public RawImage MG;
    Texture2D cam;


    public void Start()
    {

        cam = new Texture2D(1 1 TextureFormat.RGB24 false);
MG.texture = cam;
        StartCoroutine(Fetch());
    }


    public IEnumerator Fetch()
    {
        while (true)
        {
            Debug.Log(“fetching... “ + Time.realtimeSinceStartup);

            WWWForm form = new WWWForm();
form.AddField (“port“ “8100“);
            form.AddField(“dummy“ “field“);    // required by WWWForm
            WWW www = new WWW(uri form.data new System.Collections.Generic.Dictionary() {  // using www.headers is depreciated by some odd reason
                {“Authorization“ “Basic “ + System.Convert.Tobase64String(System.Text.Encoding.ASCII.GetBytes(username+“:“+password))}
            });
            yield return www;

            if (!string.IsNullOrEmpty(www.error))
                throw new UnityException(www.error);

            www.LoadImageIntoTexture(cam);
        }
    }

public void OnGUI()
{

MG.texture = cam;
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-05-21 11:35  NetCameraTest5.4\
     目录           0  2018-03-15 17:20  NetCameraTest5.4\.vs\
     目录           0  2018-03-15 17:20  NetCameraTest5.4\.vs\NetCameraTest5.4\
     目录           0  2018-03-15 17:21  NetCameraTest5.4\.vs\NetCameraTest5.4\v14\
     文件       27648  2018-03-22 16:23  NetCameraTest5.4\.vs\NetCameraTest5.4\v14\.suo
     文件        7978  2018-05-03 15:45  NetCameraTest5.4\Assembly-CSharp-Editor.csproj
     文件        5456  2018-05-03 17:30  NetCameraTest5.4\Assembly-CSharp-firstpass.csproj
     文件        5115  2018-05-21 11:32  NetCameraTest5.4\Assembly-CSharp.csproj
     文件        5080  2018-05-21 11:31  NetCameraTest5.4\Assembly-Unityscript.unityproj
     目录           0  2018-05-21 11:32  NetCameraTest5.4\Assets\
     目录           0  2018-05-21 11:31  NetCameraTest5.4\Assets\Plugins\
     目录           0  2018-05-21 11:36  NetCameraTest5.4\Assets\Plugins\Linux\
     文件         193  2016-08-15 05:22  NetCameraTest5.4\Assets\Plugins\Linux.meta
     目录           0  2018-05-21 11:36  NetCameraTest5.4\Assets\Plugins\MacOS\
     文件         193  2016-08-15 05:25  NetCameraTest5.4\Assets\Plugins\MacOS.meta
     目录           0  2018-05-21 11:29  NetCameraTest5.4\Assets\Plugins\x86\
     目录           0  2018-05-21 11:36  NetCameraTest5.4\Assets\Plugins\x86\plugins\
     文件         193  2016-08-15 05:25  NetCameraTest5.4\Assets\Plugins\x86\plugins.meta
     文件         191  2018-04-16 14:17  NetCameraTest5.4\Assets\Plugins\x86.meta
     目录           0  2018-05-21 11:29  NetCameraTest5.4\Assets\Plugins\x86_64\
     目录           0  2018-05-21 11:31  NetCameraTest5.4\Assets\Plugins\x86_64\plugins\
     文件      134656  2017-09-09 15:16  NetCameraTest5.4\Assets\Plugins\x86_64\plugins\AudioRender.dll
     文件         942  2018-04-11 14:18  NetCameraTest5.4\Assets\Plugins\x86_64\plugins\AudioRender.dll.meta
     文件     2526056  2017-09-09 15:16  NetCameraTest5.4\Assets\Plugins\x86_64\plugins\D3DCompiler_43.dll
     文件         942  2018-04-11 14:18  NetCameraTest5.4\Assets\Plugins\x86_64\plugins\D3DCompiler_43.dll.meta
     文件      306176  2017-09-09 15:16  NetCameraTest5.4\Assets\Plugins\x86_64\plugins\EagleEyeRender.dll
     文件         942  2018-04-11 14:18  NetCameraTest5.4\Assets\Plugins\x86_64\plugins\EagleEyeRender.dll.meta
     文件     2166272  2017-09-09 15:16  NetCameraTest5.4\Assets\Plugins\x86_64\plugins\GdiPlus.dll
     文件         942  2018-04-11 14:18  NetCameraTest5.4\Assets\Plugins\x86_64\plugins\GdiPlus.dll.meta
     文件     2190336  2017-09-09 15:28  NetCameraTest5.4\Assets\Plugins\x86_64\plugins\HCCore.dll
     文件         942  2018-04-11 14:18  NetCameraTest5.4\Assets\Plugins\x86_64\plugins\HCCore.dll.meta
............此处省略1899个文件信息

评论

共有 条评论