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.
40 lines
1.4 KiB
40 lines
1.4 KiB
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
|
|
namespace UnityEditor.U2D.Aseprite
|
|
{
|
|
internal class AsepriteImporterEditorExternalData : ScriptableObject
|
|
{
|
|
[SerializeField]
|
|
public List<TextureImporterPlatformSettings> platformSettings = new List<TextureImporterPlatformSettings>();
|
|
|
|
public void Init(AsepriteImporter importer, IList<TextureImporterPlatformSettings> platformSettingsNeeded)
|
|
{
|
|
var importerPlatformSettings = importer.GetAllPlatformSettings();
|
|
|
|
for (var i = 0; i < importerPlatformSettings.Length; ++i)
|
|
{
|
|
var tip = importerPlatformSettings[i];
|
|
var setting = platformSettings.FirstOrDefault(x => x.name == tip.name);
|
|
if (setting == null)
|
|
{
|
|
TextureImporterUtilities.UpdateWithDefaultSettings(ref tip);
|
|
platformSettings.Add(tip);
|
|
}
|
|
}
|
|
|
|
for (var i = 0; i < platformSettingsNeeded.Count; ++i)
|
|
{
|
|
var ps = platformSettingsNeeded[i];
|
|
var setting = platformSettings.FirstOrDefault(x => x.name == ps.name);
|
|
if (setting == null)
|
|
{
|
|
TextureImporterUtilities.UpdateWithDefaultSettings(ref ps);
|
|
platformSettings.Add(ps);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|