错误 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”。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)