luoyikun

导航

unity3d:子类父类共用同个public变量,多次序列化报错

The same field name is serialized multiple times in the class or its parent class. This is not supported: Base(MonoBehaviour) txtTitle
UnityEditor.HostView:OnGUI()

工程中搜索txtTitle
可以看到
父类

public abstract class UILoading
    {
        public Text txtTitle;
        public Text txtTips;

子类

public class UISimpleLoading:UILoading
    {
        public Text txtTitle;
        public Text txtTips;

这样在编辑器中是正常的,但是不能打包,不可多次序列化,要子类或者父类改名

posted on 2018-06-28 15:50  luoyikun  阅读(95)  评论(0)    收藏  举报  来源