Skip to content

Clearly document unity scenarios that require AOT#1264

Merged
AArnott merged 1 commit intomasterfrom
fix471
Jun 21, 2021
Merged

Clearly document unity scenarios that require AOT#1264
AArnott merged 1 commit intomasterfrom
fix471

Conversation

@AArnott
Copy link
Copy Markdown
Collaborator

@AArnott AArnott commented Jun 13, 2021

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
Copy link
Copy Markdown

bitinn commented Jun 14, 2021 via email

@bitinn
Copy link
Copy Markdown

bitinn commented Jun 14, 2021 via email

@AArnott
Copy link
Copy Markdown
Collaborator Author

AArnott commented Jun 14, 2021

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

Copy link
Copy Markdown
Member

@neuecc neuecc left a comment

Choose a reason for hiding this comment

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

Thanks.

@neuecc
Copy link
Copy Markdown
Member

neuecc commented Jun 16, 2021

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
Copy link
Copy Markdown

bitinn commented Jun 17, 2021

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
Copy link
Copy Markdown
Collaborator Author

AArnott commented Jun 21, 2021

@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