UniVRM/Assets/VRMShaders/GLTF/IO/Runtime/TextureDescriptorSet.cs
2021-05-27 15:38:40 +09:00

28 lines
734 B
C#

using System.Collections.Generic;
namespace VRMShaders
{
/// <summary>
/// TextureImportParam の集合を Unique な集合にする。
/// </summary>
public sealed class TextureDescriptorSet
{
private readonly Dictionary<SubAssetKey, TextureImportParam> _params = new Dictionary<SubAssetKey, TextureImportParam>();
public void Add(TextureImportParam param)
{
if (_params.ContainsKey(param.SubAssetKey)) return;
_params.Add(param.SubAssetKey, param);
}
public IEnumerable<TextureImportParam> GetEnumerable()
{
foreach (var kv in _params)
{
yield return kv.Value;
}
}
}
}