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;
    }
}
原文地址:https://www.cnblogs.com/Peng18233754457/p/9732776.html