public override BMSByte Serialized()
{
serializedBuffer.Clear();
PrepareNextSerializedTransform(serializePosition, transform.position);
// Sending rotation across the network as a Vector3 instead of Vector4 to save bandwidth
PrepareNextSerializedTransform(serializeRotation, transform.eulerAngles);
PrepareNextSerializedTransform(serializeScale, transform.localScale);
if (Properties != null)
{
foreach (NetRef<object> obj in Properties)
{
ObjectMapper.MapBytes(serializedBuffer, obj.Value);
obj.Callback(this);
}
}
return serializedBuffer;
}