Singularity/Library/PackageCache/com.unity.2d.psdimporter@6.0.7/Editor/PSDImporterEditorExternalDa...

40 lines
1.2 KiB
C#
Raw Normal View History

2024-05-06 14:45:45 -04:00
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEditor.U2D.Common;
using UnityEngine;
namespace UnityEditor.U2D.PSD
{
internal class PSDImporterEditorExternalData : ScriptableObject
{
[SerializeField]
public List<TextureImporterPlatformSettings> platformSettings = new List<TextureImporterPlatformSettings>();
public void Init(PSDImporter importer, IList<TextureImporterPlatformSettings> platformSettingsNeeded)
{
var importerPlatformSettings = importer.GetAllPlatformSettings();
for (int i = 0; i < importerPlatformSettings.Length; ++i)
{
var tip = importerPlatformSettings[i];
var setting = platformSettings.FirstOrDefault(x => x.name == tip.name);
if (setting == null)
{
platformSettings.Add(tip);
}
}
foreach (var ps in platformSettingsNeeded)
{
var setting = platformSettings.FirstOrDefault(x => x.name == ps.name);
if (setting == null)
{
platformSettings.Add(ps);
}
}
}
}
}