This commit is contained in:
wsh
2025-05-27 11:44:09 +09:00
parent 93b6fa3801
commit 646123646d
2 changed files with 0 additions and 36 deletions

View File

@@ -1,34 +0,0 @@
using UnityEngine;
using MessagePack;
using MessagePack.Formatters;
using MessagePack.Resolvers;
using System;
using System.Collections.Generic;
public class CustomMessagePackResolver : IFormatterResolver
{
public static readonly IFormatterResolver Instance = new CustomMessagePackResolver();
private static readonly Dictionary<Type, object> formatters = new Dictionary<Type, object>
{
{ typeof(Studio.AssetTool.MaterialPropertyData), new MessagePack.Formatters.XED.Manage.MaterialPropertyDataFormatter() },
{ typeof(Studio.AssetTool.ModelData), new MessagePack.Formatters.XED.Manage.ModelDataFormatter() },
{ typeof(Studio.AssetTool.SaveData), new MessagePack.Formatters.XED.Manage.SaveDataFormatter() },
{ typeof(Studio.AssetTool.SavedModelData), new MessagePack.Formatters.XED.Manage.SavedModelDataFormatter() },
{ typeof(Studio.Manage.SerializableMesh), new MessagePack.Formatters.XED.Manage.SerializableMeshFormatter() },
{ typeof(Studio.Manage.SerializableQuaternion), new MessagePack.Formatters.XED.Manage.SerializableQuaternionFormatter() },
{ typeof(Studio.Manage.SerializableVector2), new MessagePack.Formatters.XED.Manage.SerializableVector2Formatter() },
{ typeof(Studio.Manage.SerializableVector3), new MessagePack.Formatters.XED.Manage.SerializableVector3Formatter() },
{ typeof(Studio.Manage.SubmeshData), new MessagePack.Formatters.XED.Manage.SubmeshDataFormatter() },
{ typeof(Studio.AssetTool.TextureData), new MessagePack.Formatters.XED.Manage.TextureDataFormatter() },
{ typeof(Studio.Manage.TransformData), new MessagePack.Formatters.XED.Manage.TransformDataFormatter() },
};
public IMessagePackFormatter<T> GetFormatter<T>()
{
if (formatters.TryGetValue(typeof(T), out var formatter))
{
return (IMessagePackFormatter<T>)formatter;
}
return StandardResolver.Instance.GetFormatter<T>();
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 47d35b011d941df44a78fe2904fcc881