首页 > 手游开发 > Unity3D > `UnityEngine.Texture.Texture()’ is inaccessible due to its protection level
2019
03-18

`UnityEngine.Texture.Texture()’ is inaccessible due to its protection level

在Unity 2018打开旧版本Unity项目,报了下面的两个错误:

Cannot access protected member `UnityEngine.Texture.Texture()’ via a qualifier of type `UnityEngine.Texture’.

`UnityEngine.Texture.Texture()’ is inaccessible due to its protection level

`UnityEngine.Texture.Texture()' is inaccessible due to its protection level - 第1张  | 逗分享开发经验

 

解决方法:

new Texture()改为new Texture2D(),由于Texture2D()需要两个返回值,所以你要输入两个任意值。

`UnityEngine.Texture.Texture()' is inaccessible due to its protection level - 第2张  | 逗分享开发经验

最后编辑:
作者:游戏创作者大陆

留下一个回复

你的email不会被公开。