Skip to content

Built-in Support for Common C# Types (Vector3, Quaternion, Matrix4x4, etc.) #1593

@juhani-honkala

Description

@juhani-honkala

I have faced challenges when attempting to serialize and deserialize common C# types like Vector3, Quaternion, and Matrix4x4 with the existing implementation.

As a result, I kindly propose incorporating built-in support for these widely-used C# types to enhance the user experience and provide value to all users. With built-in support in place, reliance on custom serializers and deserializers—which are challenging to create, prone to errors, and difficult to utilize—would be eliminated. The present workarounds lack elegance and may discourage users from embracing the library. Implementing built-in support would undoubtedly increase the library's versatility and user-friendliness.

This, please consider adding support - thanks a lot!

ps. Memorypack has a good list of built-in types to support (https://github.com/Cysharp/MemoryPack):

.NET primitives (byte, int, bool, char, double, etc.)
Unmanaged types (Any enum, Any user-defined struct which doesn't contain reference types)
string, decimal, Half, Int128, UInt128, Guid, Rune, BigInteger
TimeSpan, DateTime, DateTimeOffset, TimeOnly, DateOnly, TimeZoneInfo
Complex, Plane, Quaternion Matrix3x2, Matrix4x4, Vector2, Vector3, Vector4
Uri, Version, StringBuilder, Type, BitArray, CultureInfo
T[], T[,], T[,,], T[,,,], Memory<>, ReadOnlyMemory<>, ArraySegment<>, ReadOnlySequence<>
Nullable<>, Lazy<>, KeyValuePair<,>, Tuple<,...>, ValueTuple<,...>
List<>, LinkedList<>, Queue<>, Stack<>, HashSet<>, SortedSet<>, PriorityQueue<,>
Dictionary<,>, SortedList<,>, SortedDictionary<,>, ReadOnlyDictionary<,>
Collection<>, ReadOnlyCollection<>, ObservableCollection<>, ReadOnlyObservableCollection<>
IEnumerable<>, ICollection<>, IList<>, IReadOnlyCollection<>, IReadOnlyList<>, ISet<>
IDictionary<,>, IReadOnlyDictionary<,>, ILookup<,>, IGrouping<,>,
ConcurrentBag<>, ConcurrentQueue<>, ConcurrentStack<>, ConcurrentDictionary<,>, BlockingCollection<>
Immutable collections (ImmutableList<>, etc.) and interfaces (IImmutableList<>, etc.)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions