Singularity/Library/PackageCache/com.unity.2d.animation@7.0.10/Editor/SkinningModule/SkinningCopyUtility.cs

35 lines
1.1 KiB
C#
Raw Permalink Normal View History

2024-05-06 14:45:45 -04:00
namespace UnityEditor.U2D.Animation
{
internal static class SkinningCopyUtility
{
private static ISkinningSerializer s_SkinningSerializer = new SkinningSerializerJSON();
public static ISkinningSerializer Serializer
{
get { return s_SkinningSerializer; }
set { s_SkinningSerializer = value; }
}
public static string SerializeSkinningCopyDataToString(SkinningCopyData skinningData)
{
return s_SkinningSerializer.Serialize(skinningData);
}
public static bool CanDeserializeSystemCopyBufferToSkinningCopyData()
{
if (!string.IsNullOrEmpty(EditorGUIUtility.systemCopyBuffer))
return CanDeserializeStringToSkinningCopyData(EditorGUIUtility.systemCopyBuffer);
return false;
}
public static bool CanDeserializeStringToSkinningCopyData(string data)
{
return s_SkinningSerializer.CanDeserialize(data);
}
public static SkinningCopyData DeserializeStringToSkinningCopyData(string data)
{
return s_SkinningSerializer.Deserialize(data);
}
}
}