Unity导入最新UFPS后报错
Error after importing UFPS latest in Unity
我刚刚统一下载了 UFPS 资产,但在导入后出现了一些错误。我无法在网上找到解决该问题的方法。
Unity 版本:2018
错误:
Assets/UFPS/Base/Scripts/Gameplay/Player/Local/vp_LocalPlayer.cs(62,46): error CS1540: Cannot access protected member UnityEngine.Texture.Texture()' via a qualifier of type
UnityEngine.Texture'. The qualifier must be of type `vp_LocalPlayer' or derived from it
:
Assets/UFPS/Base/Scripts/Gameplay/Player/Local/vp_LocalPlayer.cs(62,46): error CS0122: `UnityEngine.Texture.Texture()' is inaccessible due to its protection level
错误行:
static Texture m_InvisibleTexture = new Texture();
静态纹理m_InvisibleTexture = 新纹理(); // 错误
静态纹理 m_InvisibleTexture = null; // 没有错误
将你的行替换为
private static Texture m_InvisibleTexture = new Texture2D(2, 2);
您还会 运行 遇到此错误:
Assets/UFPS/Base/Scripts/Gameplay/Editor/vp_FootstepManagerEditor.cs(228,25):
error CS0143: The class `UnityEngine.AudioClip' has no constructors
defined
这里有一个 link 修复程序以及您将遇到的问题的更多信息:
http://www.opsive.com/assets/UFPS/forum/index.php?p=/discussion/3979/2018-compatibility
我刚刚统一下载了 UFPS 资产,但在导入后出现了一些错误。我无法在网上找到解决该问题的方法。
Unity 版本:2018
错误:
Assets/UFPS/Base/Scripts/Gameplay/Player/Local/vp_LocalPlayer.cs(62,46): error CS1540: Cannot access protected member
UnityEngine.Texture.Texture()' via a qualifier of type
UnityEngine.Texture'. The qualifier must be of type `vp_LocalPlayer' or derived from it
:
Assets/UFPS/Base/Scripts/Gameplay/Player/Local/vp_LocalPlayer.cs(62,46): error CS0122: `UnityEngine.Texture.Texture()' is inaccessible due to its protection level
错误行:
static Texture m_InvisibleTexture = new Texture();
静态纹理m_InvisibleTexture = 新纹理(); // 错误 静态纹理 m_InvisibleTexture = null; // 没有错误
将你的行替换为
private static Texture m_InvisibleTexture = new Texture2D(2, 2);
您还会 运行 遇到此错误:
Assets/UFPS/Base/Scripts/Gameplay/Editor/vp_FootstepManagerEditor.cs(228,25): error CS0143: The class `UnityEngine.AudioClip' has no constructors defined
这里有一个 link 修复程序以及您将遇到的问题的更多信息:
http://www.opsive.com/assets/UFPS/forum/index.php?p=/discussion/3979/2018-compatibility