When using Protobuf-net in Unity3D, if your Proto-Contracts include generics you might run into a few issues like Unable to resolve MapDecorator constructor.
I had to work with the following contract. It was s custom collection class which had a functionality of caching removed elements in the collection.
[ProtoContract]
public class CustomCollectionBase<TCollection, TElement, TKey{
[ProtoMember(1)]
protected TCollection _collection;
[ProtoMember(2)]
protected SortedDictionary<TKey, bool_removed;
public CustomCollectionBase(TCollection collection)
{
_collection = collection;
}
}
[ProtoContract]
public class CustomList<TElement: CustomCollectionBase<List<TElement, TElement, int{
public CustomList() : base( new List<TElement())
{
}
}
[ProtoContract]
public class CustomIntDictionary<TElement: CustomCollectionBase<Dictionary<int,
…