Class GhostCustomSerializerExtensions
Extension methods for all unmanaged types implementing the
IGhostSerializer interface.
Inheritance
GhostCustomSerializerExtensions
Assembly: Unity.NetCode.dll
Syntax
public static class GhostCustomSerializerExtensions
Methods
SerializeBuffer<TSerializer>(TSerializer, IntPtr, IntPtr, IntPtr, IntPtr, IntPtr, ref int, ref int, ref int, ref DataStreamWriter, in StreamCompressionModel, int)
Serialize a single buffer to the datastream using the default buffer serialisation
strategy.
Declaration
public static int SerializeBuffer<TSerializer>(this TSerializer serializer, IntPtr snapshot, IntPtr baseline, IntPtr snapshotDynamicData, IntPtr baselineDynamicData, IntPtr changeMaskData, ref int startOffset, ref int snapshotOffset, ref int dynamicSize, ref DataStreamWriter writer, in StreamCompressionModel compressionModel, int sendBuffer = 1) where TSerializer : unmanaged, IGhostSerializer
Parameters
Type |
Name |
Description |
TSerializer |
serializer |
|
IntPtr |
snapshot |
|
IntPtr |
baseline |
|
IntPtr |
snapshotDynamicData |
|
IntPtr |
baselineDynamicData |
|
IntPtr |
changeMaskData |
|
int |
startOffset |
|
int |
snapshotOffset |
|
int |
dynamicSize |
|
DataStreamWriter |
writer |
|
StreamCompressionModel |
compressionModel |
|
int |
sendBuffer |
|
Returns
Type Parameters
Name |
Description |
TSerializer |
|
SerializeComponentSingleBaseline<TSerializer>(TSerializer, IntPtr, in IntPtr, IntPtr, ref int, ref int, ref DataStreamWriter, in StreamCompressionModel, int)
Serialize the given component into the data stream by using a single baseline.
Declaration
public static int SerializeComponentSingleBaseline<TSerializer>(this TSerializer serializer, IntPtr snapshot, in IntPtr baseline, IntPtr changeMaskData, ref int startOffset, ref int snapshotOffset, ref DataStreamWriter writer, in StreamCompressionModel compressionModel, int sendComponent = 1) where TSerializer : unmanaged, IGhostSerializer
Parameters
Type |
Name |
Description |
TSerializer |
serializer |
|
IntPtr |
snapshot |
|
IntPtr |
baseline |
|
IntPtr |
changeMaskData |
|
int |
startOffset |
|
int |
snapshotOffset |
|
DataStreamWriter |
writer |
|
StreamCompressionModel |
compressionModel |
|
int |
sendComponent |
|
Returns
Type Parameters
Name |
Description |
TSerializer |
|
SerializeComponentThreeBaseline<TSerializer>(TSerializer, IntPtr, IntPtr, IntPtr, IntPtr, IntPtr, ref int, ref int, ref GhostDeltaPredictor, ref DataStreamWriter, in StreamCompressionModel, int)
Serialize the given component into the data stream by using three baselines.
The GhostDeltaPredictor will calculate new predicted baseline that
will be used for delta compression.
Declaration
public static int SerializeComponentThreeBaseline<TSerializer>(this TSerializer serializer, IntPtr snapshot, IntPtr baseline0, IntPtr baseline1, IntPtr baseline2, IntPtr changeMaskData, ref int startOffset, ref int snapshotOffset, ref GhostDeltaPredictor predictor, ref DataStreamWriter writer, in StreamCompressionModel compressionModel, int sendComponent = 1) where TSerializer : unmanaged, IGhostSerializer
Parameters
Returns
Type Parameters
Name |
Description |
TSerializer |
|
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.