当我试图让List
公开,像这样:可访问性不一致申请类型system.collections.generic.list
public List<Enemy> enemies;
我得到了以下错误:
Inconsistent accessibility: field type 'System.Collections.Generic.List'...
当我试图让List
公开,像这样:可访问性不一致申请类型system.collections.generic.list
public List<Enemy> enemies;
我得到了以下错误:
Inconsistent accessibility: field type 'System.Collections.Generic.List'...
这可能是因为Enemy
不是public
The type of a field cannot be less accessible than the field itself because all public constructs must return a publicly accessible object.
你的班级“敌人”可达性是什么?如果您正在使用对象列表,它应该是公开的。
它不应该公开,因为他使用的是一个对象列表,它应该是公开的,因为有一个公共字段。 – 2014-09-04 20:02:07
等级敌人不公开... – 2014-09-04 19:58:09
好吧,如果你的班级'Enemy'不是出版社,那么这将回答你自己的问题。 – MethodMan 2014-09-04 19:59:50
如果你打算提到你问的问题,甚至2个小时前,至少链接到它。 – 2014-09-04 20:11:26