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

32 lines
727 B
C#
Raw Permalink Normal View History

2024-05-06 14:45:45 -04:00
using UnityEngine;
namespace UnityEditor.U2D.Animation
{
internal class SkinningSerializerJSON : ISkinningSerializer
{
public bool CanDeserialize(string data)
{
bool result = true;
try
{
JsonUtility.FromJson<SkinningCopyData>(data);
}
catch
{
result = false;
}
return result;
}
public SkinningCopyData Deserialize(string data)
{
return JsonUtility.FromJson<SkinningCopyData>(data);
}
public string Serialize(SkinningCopyData skinningData)
{
return JsonUtility.ToJson(skinningData);
}
}
}