wuxianshengcong/Library/PackageCache/com.unity.2d.aseprite@1.1.6/Editor/AsepriteImporterEditorExternalData.cs
2025-01-02 14:50:41 +08:00

43 lines
1.3 KiB
C#

using System.Collections.Generic;
using UnityEngine;
namespace UnityEditor.U2D.Aseprite
{
internal class AsepriteImporterEditorExternalData : ScriptableObject
{
[SerializeField]
public List<TextureImporterPlatformSettings> platformSettings = new();
public void Init(AsepriteImporter importer, IList<TextureImporterPlatformSettings> platformSettingsNeeded)
{
var importerPlatformSettings = importer.GetAllPlatformSettings();
foreach (var tip in importerPlatformSettings)
{
var j = 0;
for (j = 0; j < platformSettings.Count; ++j)
{
if (platformSettings[j].name == tip.name)
break;
}
if (j >= platformSettings.Count)
platformSettings.Add(tip);
}
foreach (var ps in platformSettingsNeeded)
{
var j = 0;
for (j = 0; j < platformSettings.Count; ++j)
{
if (platformSettings[j].name == ps.name)
break;
}
if (j >= platformSettings.Count)
platformSettings.Add(ps);
}
}
}
}