微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

错误 CS0103:当前上下文中不存在名称“WebCamTexture”

如何解决错误 CS0103:当前上下文中不存在名称“WebCamTexture”

当我使用 WebRTCVidechat 将我的项目构建到 magicleap 硬件时,它会中止操作并发送一条日志错误消息,指出“Assets\WebRtcVideoChat\scripts\UnityCallFactory.cs(1073,37): error CS0103: The name 'WebCamTexture' does not exist in the current context”。

在构建之前不会出现编译器错误

部分代码

using UnityEngine;
using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;
...
        foreach (var dev in WebCamTexture.devices)
                {
                    if (deviceName == dev.name)
                    {
                        if (dev.isFrontFacing)
                        {
                            return true;
                        }
                        else
                        {
                            return false;
                        }
                    }
                }

日志:

Assets\WebRtcVideoChat\scripts\UnityCallFactory.cs(1073,37):错误 CS0103:当前上下文中不存在名称“WebCamTexture”。

解决方法

错误 CS0103:当前上下文中不存在名称“WebCamTexture””,这是由于与我为 (MagicLeap) 构建的平台不兼容造成的。

我没有找到任何解决方案来修复它。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。