Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonXuDeveloper committed Jul 2, 2024
1 parent dcdf4fd commit d83049b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Docs/Serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ public partial struct NotAutoCollectStruct
- 需要有空参数的构造函数
- 如果定义了不支持序列化的类型(如Queue)则会导致编译错误
- 暂时需要序列化端和反序列化端需要使用Nino序列化的类型一一对应(即假设我在A项目里用了Nino去序列化,有10个NinoType类型,那么我在B项目里反序列化A项目生成的二进制时,需确保B项目里也不多不少只有这10个NinoType类型)

> 该限制目前可以通过把一个工程生成的代码复制出来给另一个工程使用(NinoSerializerExtension.(Ext.)g.cs和NinoDeserializerExtension.(Ext.)g.cs)
>
> 这样就不需要去管两个工程之间类型数量是否对照了
>
> 这个问题出现的原因是因为要兼容多态所以需要给每个类型分配一个TypeId,目前是按全部NinoType的类型名字按顺序分配的ID,所以才需要保证不同工程之间的Nino类型名称一致,不然两个工程生成的TypeId会不一致从而导致无法跨工程反序列化数据,如果有朋友有解决方案欢迎PR
## Unity支持

Expand Down

0 comments on commit d83049b

Please sign in to comment.