Vuforia打开关闭摄像机

2023-08-24 13:48:48 浏览数 (1)

代码语言:javascript复制
    // 关闭相机
    public void CloseCameraDevice()
    {
        CameraDevice.Instance.Stop();
        CameraDevice.Instance.Deinit();
    }

    // 打开相机
    public void OpenCameraDevice()
    {
        CameraDevice.Instance.Init(CameraDevice.CameraDirection.CAMERA_DEFAULT);
        CameraDevice.Instance.Start();
    }

    // 关闭识别
    public void CloseCloudReco()
    {
        CloudRecoBehaviour cloudRecoBehaviour = GameObject.FindObjectOfType(typeof(CloudRecoBehaviour)) as CloudRecoBehaviour;
        cloudRecoBehaviour.CloudRecoEnabled = false;
    }

    // 打开识别
    public void OpenCloudReco()
    {
        CloudRecoBehaviour cloudRecoBehaviour = GameObject.FindObjectOfType(typeof(CloudRecoBehaviour)) as CloudRecoBehaviour;
        cloudRecoBehaviour.CloudRecoEnabled = true;
    }

0 人点赞