Coder Social home page Coder Social logo

Comments (4)

jacobdufault avatar jacobdufault commented on August 11, 2024

Can you copy+paste the aot converter file for SaveData? Registration should happen automatically with fsConverterRegistrar. It looks like the aot converter is not getting used. Maybe put a Debug.LogError in fsReflectedConverter.TrySerialize with the type?

If you can send me the project at my email ([myname]@gmail.com) then I can take a closer look as well.

from fullserializer.

treefortress avatar treefortress commented on August 11, 2024

Ok, I think I got to the bottom of it. The aotConverter for my SaveData class was failing, I didn't notice as the other 17 classes were created successfully.

Turns out the problem was read-only virtual-properties

You can reproduce the error by trying to serialize something like this:

public class SerializeTest {
    public int Foo { get; private set; }
}

This will fail AOT Compilation, and the file will not be created.

Workarounds are to just make the property public,

    public int Foo { get; set; }

or, manually back it with a variable:

    int foo;
    public int Foo { get { return foo; } private set { foo = value; } }

from fullserializer.

jacobdufault avatar jacobdufault commented on August 11, 2024

Okay, good to know. Unfortunately it isn't technically possible to work around this on my end.

from fullserializer.

treefortress avatar treefortress commented on August 11, 2024

Ok, no big deal, might be a good idea to call it our in the readme though, as this seems misleading:
"Auto-properties that are at least partially public are serialized by default"

Also, I've just realized that Internal properties are ignored by the serializer as well.

Makes sense that it's not technically possible to serialize these, but since the Unity serializer does work on both types, it can lead to some confusion.

from fullserializer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.