Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/unity3d/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 有没有办法延迟Unity手机摄像头的视频输入?_Android_Unity3d_Google Cardboard - Fatal编程技术网

Android 有没有办法延迟Unity手机摄像头的视频输入?

Android 有没有办法延迟Unity手机摄像头的视频输入?,android,unity3d,google-cardboard,Android,Unity3d,Google Cardboard,我正在做一个项目,在这个项目中,你应该能够改变手机摄像头显示信息的延迟,这样人们就可以看到他们的大脑如何处理延迟/延迟。我已经设法在画布上显示了摄像头提要,该画布跟随摄像头四处移动,并填满了谷歌硬纸板的整个视图,但我想知道如何延迟此视频提要。也许通过使用某种图像数组 我曾尝试在网上搜索解决方案,但没有找到答案。我尝试了texture2D阵列,但性能非常差(我尝试了的修改版本) private bool-caml可用; 私人网络摄像机; 私人背景; 公众形象背景; 公共方面比较合适; //在第一帧

我正在做一个项目,在这个项目中,你应该能够改变手机摄像头显示信息的延迟,这样人们就可以看到他们的大脑如何处理延迟/延迟。我已经设法在画布上显示了摄像头提要,该画布跟随摄像头四处移动,并填满了谷歌硬纸板的整个视图,但我想知道如何延迟此视频提要。也许通过使用某种图像数组

我曾尝试在网上搜索解决方案,但没有找到答案。我尝试了texture2D阵列,但性能非常差(我尝试了的修改版本)

private bool-caml可用;
私人网络摄像机;
私人背景;
公众形象背景;
公共方面比较合适;
//在第一帧更新之前调用Start
void Start()
{
defaultBackground=background.texture;
WebCamDevice[]设备=WebCamTexture.devices;
如果(devices.Length==0)
{
Debug.Log(“未检测到摄像头”);
camavable=false;
返回;
}
对于(int i=0;i
我应该使用某种帧缓冲区或图像/纹理数组来延迟视频吗?(开始“录制”,等待指定的时间,开始在屏幕上播放“视频”)

提前谢谢

    private bool camAvailable;
    private WebCamTexture backCam;
    private Texture defaultBackground;

    public RawImage background;
    public AspectRatioFitter fit;


    // Start is called before the first frame update
    void Start()
    {
        defaultBackground = background.texture;
        WebCamDevice[] devices = WebCamTexture.devices;

        if (devices.Length == 0 )
        {
            Debug.Log("No camera detected");
            camAvailable = false;
            return;
        }

        for (int i = 0; i < devices.Length; i++)
        {
            if (!devices[i].isFrontFacing)
            {
                backCam = new WebCamTexture(devices[i].name, Screen.width, Screen.height); // Used to find the correct camera
            }
        }

        if (backCam == null)
        {
            Debug.Log("Unable to find back camera");
            return;
        }

        backCam.Play();
        background.texture = backCam;

        camAvailable = true;
    } //Tell me if this is not enough code, I don't really have a lot of experience in Unity, so I am unsure of how much is required for a minimal reproducible example