コード例 #1
0
 void OnDestroy()
 {
     if (libcsv != null)
     {
         LibCSV.unInitLib();
     }
 }
コード例 #2
0
    void Start()
    {
        string path    = Application.dataPath;
        string sdkpath = path + "/../SDKDLL";

        libcsv = LibCSV.InitLib(sdkpath);
        tex    = new Texture2D(1280, 720, TextureFormat.RGBA32, false);
        GetComponent <UITexture>().mainTexture = tex;
        StartCoroutine("Display");
    }
コード例 #3
0
ファイル: HelloWorld.cs プロジェクト: Physics-EA/ChenYun
    // Use this for initialization
    public void Start()
    {
        //
        string path    = Application.dataPath;
        string sdkpath = path + "/../SDKDLL";

        libcsv = LibCSV.InitLib(sdkpath);

        txt2dtest = new Texture2D(1280, 720, TextureFormat.RGBA32, false);
        GameObject.FindGameObjectWithTag("Game1BG").GetComponent <UITexture>().mainTexture = txt2dtest;
    }
コード例 #4
0
 /// <summary>
 /// 每隔 1.0f / 26 秒播放一帧动画
 /// </summary>
 IEnumerator Display()
 {
     while (true)
     {
         byte[] videoData = LibCSV.GetCurrentVideoData();
         if (tex != null && videoData != null)
         {
             if (videoData.Length == tex.width * tex.height * 4)
             {
                 tex.LoadRawTextureData(videoData);
                 tex.Apply();
                 LibCSV.SetWrite();
             }
         }
         yield return(new WaitForSeconds(1.0f / 26));
     }
 }
コード例 #5
0
ファイル: HelloWorld.cs プロジェクト: Physics-EA/ChenYun
    void Update()
    {
        mTimer = mTimer - Time.deltaTime;
        if (mTimer < 0)
        {
            mTimer = 0.1f;

            if (libcsv != null)
            {
                Byte[] videoData = LibCSV.GetCurrentVideoData();
                if (txt2dtest != null && videoData != null)
                {
                    if (videoData.Length == txt2dtest.width * txt2dtest.height * 4)
                    {
                        txt2dtest.LoadRawTextureData(videoData);
                        txt2dtest.Apply();
                        LibCSV.SetWrite();
                    }
                }
            }
        }
    }