Skip to content

Clearly document unity scenarios that require AOT - #1264

Merged
AArnott merged 1 commit into
masterfrom
fix471
Jun 21, 2021
Merged

AArnott merged 1 commit into
masterfrom
fix471

Conversation

@AArnott

@AArnott AArnott commented Jun 13, 2021 •

Copy link
Copy Markdown
Collaborator

In response to @bitinn's suggestion here: #471 (comment)

@AArnott AArnott added this to the v2.2 milestone Jun 13, 2021
@AArnott
AArnott requested a review from neuecc June 13, 2021 21:56
@bitinn

bitinn commented Jun 14, 2021 via email

Copy link
Copy Markdown

@bitinn

bitinn commented Jun 14, 2021 via email

Copy link
Copy Markdown

@AArnott

AArnott commented Jun 14, 2021

Copy link
Copy Markdown
Collaborator Author

I don't have the answers to your questions, as Unity isn't my area. Hopefully @neuecc can clarify.

@neuecc neuecc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@neuecc

neuecc commented Jun 16, 2021

Copy link
Copy Markdown
Member

If you mean Custom class, and you want it to be automatically serializable for Custom class, it won't work.
If you want your own serializer to work, add it to Resolver or add [MessagePackFormatter(yourCustomFormatter)] to the Custom class.

@bitinn

bitinn commented Jun 17, 2021

Copy link
Copy Markdown

If you mean Custom class, and you want it to be automatically serializable for Custom class, it won't work.
If you want your own serializer to work, add it to Resolver or add [MessagePackFormatter(yourCustomFormatter)] to the Custom class.

  • Thx, to create a resolver for my custom class, I need to implement IFormatterResolver, right?
  • And if I have 10 custom classes, I need 10 resolvers, right?
  • If I go the IMessagePackFormatter route, I also need to write custom serialization/deserialization for each custom class, right?

(I am on .Net Standard 2.0, instead of .Net 4.x)

@AArnott

AArnott commented Jun 21, 2021

Copy link
Copy Markdown
Collaborator Author

@bitinn: you need one formatter per type to be serialized. A formatter needs a resolver to find it. So at minimum for 10 types, you need 10 formatters and 1 resolver.

@AArnott
AArnott merged commit 15d6851 into master Jun 21, 2021
@AArnott
AArnott deleted the fix471 branch June 21, 2021 03:21
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

Successfully merging this pull request may close these issues.

3 participants