首页 > 编程语言 > 详细

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

时间:2018-09-30 19:11:07      阅读:316      评论:0      收藏:0      [点我收藏+]

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

这里指的是 变量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;
    }
}

 

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

原文:https://www.cnblogs.com/Peng18233754457/p/9732776.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!