UnityError The same field name is serialized multiple times in the class or its parent class. This is not supported: Base(MonoBehaviour) i

相同的字段名在类或其父类中被多次序列化。这是不支持的,

这里指的是 变量i .

写如下两个脚本挂到新项目的相机上运行就会出现这个问题:

public class Father : MonoBehaviour
{
    public int e;

    private void Start()
    {
        e = 1;
    }
}
public class Son : Father
{
    public int e;

    private void Start()
    {
        e = 2;
    }
}

 

posted @ 2018-09-30 17:31  朋丶Peng  阅读(2192)  评论(0编辑  收藏  举报