unity3d - 对“Matrix4x4”类型的引用声称它在“System.Numerics”中定义,但找不到
问题描述
我正在为 Hololens 2 构建一个 Unity 项目,该项目使用System.Numerics
来自.NET
我按原样从 git 导入了这个项目,但是我遇到了几个类似于以下内容的错误:
System.Numerics.Matrix4x4 converted4x4LocationMatrix = ConvertRightHandedMatrix4x4ToLeftHanded(suObject.GetLocationAsMatrix());
error CS7069: Reference to type 'Matrix4x4' claims it is defined in 'System.Numerics', but it could not be found
System.Numerics
似乎也不见了,还有Vector3
课Vector2
。
该项目已有几年历史,因此我使用的 Unity 版本可能需要更改配置中的某些内容,以使其与将出现的“System.Numerics”版本兼容Matrix4x4
。有谁知道如何解决这一问题?
我正在Unity 2019.2.4f1
使用Windows Build Support IL2CPP
.
解决方案
好的,似乎错误是由于项目中默认使用的.Net版本是错误的。我不得不将其更改为 4.x,步骤如下:
Build Settings -> Player Settings -> Other Settings -> Api Compatibility Level并选择.Net 4.x
推荐阅读
- c++ - 在arduino中基于分隔符拆分字符串的简单方法
- javascript - 如何使对象返回到其在 HTML/CSS/JS 中的原始位置?
- javascript - 是否可以创建源映射链?
- c# - 使用 FlaUI 自动化在 WPF 应用程序中获取进度条的可见性
- javascript - Laravel 谷歌图表问题
- apache-kafka - 3 个微服务之间的数据同步
- swift - 在 SpriteKit 中运行动画后精灵的纹理没有改变
- mongodb - 连接猫鼬
- java - 为写入 Java 标准输出的所有消息添加前缀
- github - 使用 pypi2pkgbuild 从 GitHub 安装 GNS3 服务器以创建 PKGBUILD 并通过 pacman 安装所有内容时出错