mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-08 11:59:26 -05:00
GltfTextureEnumerator.Enumerate uniqueness
This commit is contained in:
@@ -52,11 +52,14 @@ namespace UniGLTF
|
||||
|
||||
public static IEnumerable<GetTextureParam> Enumerate(glTF gltf)
|
||||
{
|
||||
var used = new HashSet<GetTextureParam>();
|
||||
foreach (var material in gltf.materials)
|
||||
{
|
||||
foreach (var textureInfo in EnumerateTextures(gltf, material))
|
||||
{
|
||||
yield return textureInfo;
|
||||
if(used.Add(textureInfo)){
|
||||
yield return textureInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,10 +101,6 @@ namespace UniGLTF
|
||||
// should unique
|
||||
var gltfTextures = GltfTextureEnumerator.Enumerate(parser.GLTF);
|
||||
var distinct = gltfTextures.Distinct().ToArray();
|
||||
if (!gltfTextures.SequenceEqual(distinct))
|
||||
{
|
||||
var a = 0;
|
||||
}
|
||||
Assert.True(gltfTextures.SequenceEqual(distinct));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user