Search Unity

XmlSerializer and SerializeField

Discussion in 'Scripting' started by ccklokwerks, Mar 5, 2015.

  1. ccklokwerks

    ccklokwerks

    Joined:
    Oct 21, 2014
    Posts:
    62
    Hey all,

    I have inherited a project which uses XmlSerializer to store data in PlayerPrefs, but rather than use XML-specific tags to indicate what should be serialized, the previous developers used [SerializeField]. (Does anyone know why this even works?)

    Now I'm working on upgrading the project to 4.6.3 from 4.5.something and I am now getting hundreds of errors about the serialization depth having been (potentially) exceeded. Unfortunately I don't see a way to unscramble all of this - the project was specifically designed to possibly have nested objects.

    I guess my question is, if I replace my SerializeField tags with XML ones, should that function properly, without the Unity depth limit and errors? Or is it also subject to the same limitations as SerializeField?