1、序列化的脚本变量不能带float变量 改为double

2、脚本不能继承其他类 否则出现 如下报错
NullReferenceException
System.Reflection.MonoProperty.GetterAdapterFrame[Object,String] (System.Reflection.Getter`2 getter, System.Object obj) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoProperty.cs:234)
System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoProperty.cs:292)
System.Xml.Serialization.XmlTypeMapMember.GetValue (System.Object ob)
留意是否继承自monobehaviour
3、保存时类型要new 一下,不new就显示为null

4、保存时遇到问题
Invalid token '34' in input string
Invalid character '|' in input string
修改读取代码

5类型改为

博客主要围绕Unity游戏引擎开发展开,指出序列化脚本变量时不能用float而要改为double,脚本不能继承其他类,需留意是否继承自MonoBehaviour。保存时类型要new一下,还提及保存时遇到的报错及需修改读取代码等问题。
802

被折叠的 条评论
为什么被折叠?



