问题描述
当我使用 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) 构建的平台不兼容造成的。
我没有找到任何解决方案来修复它。