You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
727 B
C#
32 lines
727 B
C#
|
3 years ago
|
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);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|