Unity 报错之 The same field name is serialized multiple times in the class or its parent class.

Unity 报错之 同一字段名在类或其父级中序列化多次


报错图片:

报错代码:
public class BaseClass : MonoBehaviour {public GameObject gameStart;
}public class SubClass : BaseClass
{//不管是否是同一类型都会报这个错误.public GameObject gameStart;//public Transform gameStart;
}

在写子类代码时,VS会提示我们父类中有此成员,有意隐藏请使用关键字new,如下图:


解决方案:直接使用父类的定义,若不满足需求则可在子类中重新起名即可.

PS:我遇到这个问题时,怎么修改都不好用,最后重启了下Unity就好了,就很奇怪啊…

Unity 报错之 The same field name is serialized multiple times in the class or its parent class.相关推荐

  1. Unity 报错之 ToLua打包:Unable to find tolua DllNotFoundException: tolua

    Unity 报错之 ToLua打包:Unable to find tolua DllNotFoundException: tolua 最近在学习使用LuaFramework框架,使用其打出的安卓包运行 ...

  2. Unity报错之 No Sprite Editor Window registered. Please download 2D Sprite package from Package Manager.

    Unity报错之 No Sprite Editor Window registered. Please download 2D Sprite package from Package Manager. ...

  3. Unity报错:Setting the parent of a transform which resides in a Prefab......解决方案(强行设置)

    @[TOC](Setting the parent of a transform which resides in a Prefab Asset is disabled to prevent data ...

  4. Unity报错Unsupported D3D format 0x58

    Unity报错Unsupported D3D format 0x58 描述错误 每当新的视频开始播放,或者视频中的分辨率发生变化(使用HLS)时,使用DX11时都会引发错误"不支持的D3D格 ...

  5. Unity 报错之 Scope was not disposed, You should use the ‘using‘ keyword or manually call Dispose.

    Unity 报错之 Scope was not disposed! You should use the 'using' keyword or manually call Dispose. 发生错误 ...

  6. VS2019附加到Unity报错 未能完成操作,未指定的错误

    问题:Visual Studio2019 附加到Unity 报错未能完成操作,未指定的错误.编译也没有失败都成功了. 解决方法:在Unity工程中看是不是生成了.vsconfig文件,把这个删除后,再 ...

  7. Unity报错 CS0619: ‘GUITexture‘ is obsolete的解决办法

    unity加载旧版本的项目报错:Unity报错Assets\Standard Assets\Utility\ForcedReset.cs(6,27): error CS0619: 'GUITextur ...

  8. k8s创建Deployment报错:missing required field “selector“ in io.k8s.api.apps.v1.DeploymentSpec

    报错类型: [root@master ~]# kubectl create -f lzb-test.yaml error: error validating "lzb-test.yaml&q ...

  9. tolua unity 报错_Unity3D热更新之LuaFramework篇[01]--从零开始

    解压刚刚下载好的压缩包,发现里面是一个Unity工程(如图2-1),于是用 unity打开此工程. 图2-1 我使用的Unity版本为5.5.5f1,会提示需要升级,是否备份,点"Go He ...

最新文章

  1. stm32使用rtc到底用LSI还是LSE
  2. codeforces 的一些数学题
  3. JaveWeb中实现分页的总结
  4. Ubuntu 安装 JDK 问题
  5. jtessboxeditorfx 界面显示不出来_macOS 使用 XQuartz 支持 X11 实现 Linux 图形化界面显示...
  6. 带你学习javascript的函数进阶(二)
  7. 微服务最佳实践 【已翻译100%】
  8. 教你如何在机器学习竞赛中更胜一筹(上)
  9. 【Oracle】删除重复记录
  10. CMakeFiles/species.inc.dir/build.make:57: recipe for target 'CMakeFiles/species.inc' failed
  11. 西威变频器 服务器显示,西威变频器故障查询及操作方法;
  12. charles+https+安卓7.0+夜神模拟器,解决安卓7.0+版本https无法抓包问题
  13. GCN使用的数据集Cora、Citeseer、Pubmed、Tox21格式
  14. Modern C++ 书籍推荐
  15. 常见端口号一览(详细)
  16. 你 --- 短诗四句
  17. 步进电机c语言驱动原理,《步进电机【驱动电路+C语言驱动程序】》.doc
  18. 英语基础太差,到底能不能学好编程?
  19. Csdn修改账户手机绑定问题
  20. 学习笔记:发布自己的python模块安装包

热门文章

  1. Windows 2008系统如何取消Ctrl+Alt+Delete组合键登录
  2. 【matplotlib】 findfont: Font family [‘Times New Roman‘] not found. Falling back to DejaVu Sans.
  3. 心语-谨以此记录我新的旅程
  4. Python heap
  5. 关于定向耦合器(二)
  6. 2023中国玉米深加工 不断地发展与创新
  7. 微软云计算产品 Live Mesh 英文帐户已开放使用
  8. java8新特性之Lambda流常用表达式的方法合集
  9. C语言‘\0’和0和‘0’
  10. 基于android的旅游景点APP