| | 1 | | using DCL.ECSComponents; |
| | 2 | | using Google.Protobuf; |
| | 3 | |
|
| | 4 | | namespace DCLPlugins.ECSComponents |
| | 5 | | { |
| | 6 | | public static class OnPointerResultSerializer |
| | 7 | | { |
| | 8 | | public static byte[] Serialize(PBOnPointerUpResult model) |
| | 9 | | { |
| 0 | 10 | | int size = model.CalculateSize(); |
| 0 | 11 | | byte[] buffer = new byte[size]; |
| 0 | 12 | | CodedOutputStream output = new CodedOutputStream(buffer); |
| 0 | 13 | | model.WriteTo(output); |
| 0 | 14 | | return buffer; |
| | 15 | | } |
| | 16 | |
|
| | 17 | | public static byte[] Serialize(PBOnPointerDownResult model) |
| | 18 | | { |
| 0 | 19 | | int size = model.CalculateSize(); |
| 0 | 20 | | byte[] buffer = new byte[size]; |
| 0 | 21 | | CodedOutputStream output = new CodedOutputStream(buffer); |
| 0 | 22 | | model.WriteTo(output); |
| 0 | 23 | | return buffer; |
| | 24 | | } |
| | 25 | |
|
| | 26 | | public static PBOnPointerDownResult DeserializeDown(object data) |
| | 27 | | { |
| 0 | 28 | | return PBOnPointerDownResult.Parser.ParseFrom((byte[])data); |
| | 29 | | } |
| | 30 | |
|
| | 31 | | public static PBOnPointerUpResult DeserializeUp(object data) |
| | 32 | | { |
| 0 | 33 | | return PBOnPointerUpResult.Parser.ParseFrom((byte[])data); |
| | 34 | | } |
| | 35 | | } |
| | 36 | | } |