Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kyle-v opened this issue Mar 14, 2024 · 0 comments

Comments

@kyle-v
Copy link

kyle-v commented Mar 14, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant