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.

PSDImporterEditorExternalData.cs 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using UnityEditor.U2D.Common;
  5. using UnityEngine;
  6. namespace UnityEditor.U2D.PSD
  7. {
  8. internal class PSDImporterEditorExternalData : ScriptableObject
  9. {
  10. [SerializeField]
  11. public List<TextureImporterPlatformSettings> platformSettings = new List<TextureImporterPlatformSettings>();
  12. public void Init(PSDImporter importer, IList<TextureImporterPlatformSettings> platformSettingsNeeded)
  13. {
  14. var importerPlatformSettings = importer.GetAllPlatformSettings();
  15. for (int i = 0; i < importerPlatformSettings.Length; ++i)
  16. {
  17. var tip = importerPlatformSettings[i];
  18. var setting = platformSettings.FirstOrDefault(x => x.name == tip.name);
  19. if (setting == null)
  20. {
  21. platformSettings.Add(tip);
  22. }
  23. }
  24. foreach (var ps in platformSettingsNeeded)
  25. {
  26. var setting = platformSettings.FirstOrDefault(x => x.name == ps.name);
  27. if (setting == null)
  28. {
  29. platformSettings.Add(ps);
  30. }
  31. }
  32. }
  33. }
  34. }