FlowCanvas Forums › Support › Request: Make assets easier to diff in source code form › Reply To: Request: Make assets easier to diff in source code form
I think you misunderstand me.
I am aware that pushing the internal complex data structures through Unity’s serializers will not work.
However, if you look at what JSONSerializer does, then via TrySerialize()
it walks through complex internal data structures, and translates it to something simpler – a set of fsData objects, I think – and then via fsJsonPrinter.CompressedJson()
it converts the fsData tree into a single text string.
For that second step, instead of going fsData -> string, you could go fsData -> an equivalent set of C# classes which are serializable, and then leave a ref to the root of that C# object tree within the class you want to process. You would do all that as part of OnBeforeSerialize(). Then Unity will handle the actual serialization. The results will be well-structured YAML within the .asset file.
(I am not sure but I suspect it would be possible to even make the fsData class native-serializable…?)
Does that make more sense?