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

Skip serializing structs if default value #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Jake-Rich
Copy link

We already skip serializing classes that are null inside the Serialize() method, this also skips when structs are their default value.

More details in https://app.asana.com/0/1132883489782263/1207448248246156

Comment on lines +279 to +283
// For some reason Ray isn't comparible so just check it's fields
if (f.ProtoTypeName == "Ray")
{
cw.IfBracket( $"instance.{f.CsName}.origin != default && instance.{f.CsName}.direction != default" );
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Were all the other Unity types in Common.proto tested? This could be generated rather than hard coded since all that info is there.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Double check that it builds cause I got some random compile error trying to check if jobHandle == default. Only when building - not in the editor.

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.

2 participants