Unity "xxx Class" is missing the class attribute 'ExtensionOfNativeClass' 解决方案
Unity "xxx Class" is missing the class attribute 'ExtensionOfNativeClass'
翻译:‘xxx Class’缺少类属性 `ExtensionOfNativeClass`
这个就是当脚本继承了MonoBehaiour, 才会有这个属性;然而没有继承自MonoBehaviour, 却被挂到了场景中(这样的神操作不知道是怎么发生的)。
解决办法:
1) 让该类继承自`MonoBehaviour`即可,但要注意Unity对采用直接调用构造函数,如 new ClassA() 形式创建MonoBehaviour脚本对象的方式会报Warnning的;
2) 把脚本在场景中挂载中移除即可,就像删除MonoBehaviour对象一样
参考以及感谢网友们的无私贡献:
https://blog.csdn.net/Tang_AHMET/article/details/108163565
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】凌霞软件回馈社区,携手博客园推出1Panel与Halo联合会员
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步