首次提交
This commit is contained in:
30
Assets/Scripts/Common/Entity/SerializerComponent.cs
Normal file
30
Assets/Scripts/Common/Entity/SerializerComponent.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
// using Fantasy.Entitas;
|
||||
// using Fantasy.Network;
|
||||
// using Fantasy.Serialize;
|
||||
//
|
||||
// namespace NBF
|
||||
// {
|
||||
// public class SerializerComponent : Entity
|
||||
// {
|
||||
// public ISerialize Serialize;
|
||||
// public readonly MemoryStreamBufferPool BufferPool = new MemoryStreamBufferPool();
|
||||
//
|
||||
//
|
||||
// public void Initialize()
|
||||
// {
|
||||
// Serialize = SerializerManager.ProtoBufHelper;
|
||||
// }
|
||||
//
|
||||
// public byte[] Serialize<T>(T @object)
|
||||
// {
|
||||
// using var memoryStreamBuffer = BufferPool.RentMemoryStream(MemoryStreamBufferSource.None);
|
||||
// Serialize.Serialize(typeof(T), @object, memoryStreamBuffer);
|
||||
// return memoryStreamBuffer.ToArray();
|
||||
// }
|
||||
//
|
||||
// public T Deserialize<T>(byte[] bytes)
|
||||
// {
|
||||
// return Serialize.Deserialize<T>(bytes);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
Reference in New Issue
Block a user