No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UtilityStructures.cs 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System.Collections.Generic;
  2. using System.Text;
  3. using UnityEngine;
  4. namespace UnityEditor.U2D.Animation.Upgrading
  5. {
  6. internal enum UpgradeMode
  7. {
  8. SpriteLibrary,
  9. AnimationClip
  10. }
  11. internal enum UpgradeResult
  12. {
  13. None = 0,
  14. Successful = 1,
  15. Warning = 2,
  16. Error = 3
  17. }
  18. internal struct ObjectIndexPair
  19. {
  20. public Object Target;
  21. public int Index;
  22. }
  23. internal struct UpgradeEntry
  24. {
  25. public Object Target;
  26. public int Index;
  27. public UpgradeResult Result;
  28. public string Message;
  29. }
  30. internal struct UpgradeReport
  31. {
  32. public List<UpgradeEntry> UpgradeEntries;
  33. public string Log;
  34. }
  35. internal class Logger
  36. {
  37. StringBuilder m_Log = new StringBuilder();
  38. public void Add(string entry) => m_Log.AppendLine(entry);
  39. public void AddLineBreak() => m_Log.AppendLine("");
  40. public void Clear() => m_Log.Clear();
  41. public string GetLog() => m_Log.ToString();
  42. }
  43. internal static class UpgradeUtilities
  44. {
  45. const string k_PsbImporterSignature = "UnityEditor.U2D.PSD.PSDImporter";
  46. public static bool IsPsbImportedFile(string path)
  47. {
  48. return AssetImporter.GetAtPath(path).GetType().ToString() == k_PsbImporterSignature;
  49. }
  50. }
  51. }