-
Notifications
You must be signed in to change notification settings - Fork 455
feat: Native container serialization #2375
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
Conversation
…rSerializer, NetworkVariable, and RPCs.
// This simplifies things - easier to call __createNativeList() and have the implementation in C# | ||
// than to try to actually construct a NativeList in IL. This is also more future-proof. | ||
|
||
// Unlike other types, NativeList<> calls ReadValueSafeInPlace instead of ReadValueSafe. | ||
// FastBufferReader doesn't support a non-in-place deserializer for NativeList in order to | ||
// avoid users using it without realizing the allocation overhead that would cost. In-place | ||
// is more efficient when an existing value exists, and when it doesn't, it's easy to create one, | ||
// which is what we do here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed — also thanks for the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…native containers and managed types) that may be changed without setting the dirty flag.
…ion' into feat/native_container_serialization
# Conflicts: # com.unity.netcode.gameobjects/CHANGELOG.md # com.unity.netcode.gameobjects/Tests/Editor/Serialization/BaseFastBufferReaderWriterTest.cs # com.unity.netcode.gameobjects/Tests/Editor/Serialization/FastBufferReaderTests.cs # com.unity.netcode.gameobjects/Tests/Editor/Serialization/FastBufferWriterTests.cs # com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableTests.cs # com.unity.netcode.gameobjects/Tests/Runtime/RpcTests.cs
…Also I forgot to check in the merge before starting this work, so... Merge branch 'develop' into feat/native_container_serialization # Conflicts: # com.unity.netcode.gameobjects/Editor/CodeGen/NetworkBehaviourILPP.cs # com.unity.netcode.gameobjects/Editor/CodeGen/RuntimeAccessModifiersILPP.cs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me (a second time!) 😸
Support for native containers in FastBufferReader/Writer, BufferSerializer, NetworkVariable, and RPCs.
Changelog
Testing and Documentation