SkinningSerializerJSON.cs 727 B

12345678910111213141516171819202122232425262728293031
  1. using UnityEngine;
  2. namespace UnityEditor.U2D.Animation
  3. {
  4. internal class SkinningSerializerJSON : ISkinningSerializer
  5. {
  6. public bool CanDeserialize(string data)
  7. {
  8. bool result = true;
  9. try
  10. {
  11. JsonUtility.FromJson<SkinningCopyData>(data);
  12. }
  13. catch
  14. {
  15. result = false;
  16. }
  17. return result;
  18. }
  19. public SkinningCopyData Deserialize(string data)
  20. {
  21. return JsonUtility.FromJson<SkinningCopyData>(data);
  22. }
  23. public string Serialize(SkinningCopyData skinningData)
  24. {
  25. return JsonUtility.ToJson(skinningData);
  26. }
  27. }
  28. }