Singularity/Library/PackageCache/com.unity.2d.sprite@1.0.0/Editor/SpriteEditorModule/SpriteFrameModule/DefaultSpriteNameFileIdData...

27 lines
761 B
C#
Raw Permalink Normal View History

2024-05-06 14:45:45 -04:00
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace UnityEditor.U2D.Sprites
{
internal class DefaultSpriteNameFileIdDataProvider : ISpriteNameFileIdDataProvider
{
SpriteNameFileIdPair[] m_NameIDPair;
public DefaultSpriteNameFileIdDataProvider(IEnumerable<SpriteRect> spriteRects)
{
m_NameIDPair = spriteRects.Select(x => new SpriteNameFileIdPair(x.name, x.spriteID)).ToArray();
}
public IEnumerable<SpriteNameFileIdPair> GetNameFileIdPairs()
{
return m_NameIDPair;
}
public void SetNameFileIdPairs(IEnumerable<SpriteNameFileIdPair> nameFileIdPairs)
{
m_NameIDPair = nameFileIdPairs.ToArray();
}
}
}