现在引用其他Entity 要使用EntityRef
如果引用其他的Entity的 组件需要存盘和序列化,应该不需要存盘和序列化EntityRef<T>类型。
eg:
public Dictionary<long, EntityRef<Unit>> units = new();
使用MemoryPack 去序列化的时候会报错,没有注册EntityRef 这个类型。
不过应该不要给EntityRef 加上[MemoryPackable],因为我序列化的只是Unit 不是EntityRef<Unit>。
对于这种的序列化和存盘要怎么处理?