Skip to content

Deserialize to type that is only known at runtime (instead of compile type generic) like unity's JsonUtility #64

Description

@kyle-v

Hello, apologies if this is answered before:

I am looking to serialize and deserialize types where the type is not a compile time constant that can be using in a generic like <T>

In unity I can do this with JSON using this method overload:

var payloadType = Type.GetType(serializedSaveState.payloadType);
var saveStateData = JsonUtility.FromJson(serializedSaveState.payload, payloadType);

With Odin would it be possible to make a similar overload that takes in a Type instead of a generic method? Preferably for both Binary and Json formats.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions