StringBuilder sb = new StringBuilder();
为什么使用 Mono 时会产生警告?
Mono 限制:序列化格式与 .NET 不兼容
Mac 中的 Unity 5.5.2 和 Visual Studio。
我的英文很差,请理解,谢谢。
最佳答案
简短回答:您可以在自己的 Unity3D 代码中安全地忽略此警告。
更长的答案:在 https://www.mono-project.com/docs/faq/technical/ 的 Mono 技术常见问题解答中有对此警告的解释。 .具体来说,这意味着 Mono 和官方的 MS.NET 实现之间某些类的内部实现是不同的。如果您尝试在 Mono 应用程序中序列化对象(例如,将对象保存在文件中),然后尝试在 .NET 应用程序中读取该对象,这可能会导致问题。
从常见问题解答:
If you are serializing your own classes, there is no problem, since you have control over the assemblies and classes being used for serialization.
However, if you are serializing objects from the framework, serialization compatibility is not guaranteed, since the internal structure of those objects may be different. This compatibility is not even guaranteed between different MS.NET versions or Mono versions.
...
In summary, if you are designing an application that will run in different environments and platforms which are not under your control, and which need to share serialized objects (either using remoting, plain files, or whatever), you must be careful with what objects you share, and avoid objects from the framework when possible.
因此,如果您只是在 Mono 应用程序或 Unity3D 应用程序中的自己的代码中保存和加载对象,那么您可以放心地忽略此警告。
关于unity3d - unity StringBuilder Mono 限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47113537/