Beispiel #1
0
    public void updateCamImage()
    {
        bool isActive = camDevice.IsActive();

        Debug.Log("camDevice active = " + isActive);

        camImage = camDevice.GetCameraImage(pixelFormat);
        if (camImage != null)
        {
            Debug.Log("camera width = " + camImage.Width + ", height = " + camImage.Height);

            Texture2D texImage = new Texture2D(camImage.Width, camImage.Height);
            camImage.CopyToTexture(texImage);
            texImage.Apply();

            //texImage = Resources.Load ("images/150463757969262") as Texture2D ;

            Material material = capsule.GetComponent <Renderer> ().material;
            material.SetTexture("_MainTex", texImage as Texture);
        }
        else
        {
            Debug.Log("camImage : null");
        }
    }