diff --git a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/EditorMaterial.cs b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/EditorMaterial.cs index 65155353f..b00ef87aa 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/EditorMaterial.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/EditorMaterial.cs @@ -56,7 +56,7 @@ namespace UniGLTF s_foldTextures = EditorGUILayout.Foldout(s_foldTextures, "Remapped Textures"); if (s_foldTextures) { - importer.DrawRemapGUI(textureSetImporter.GetTextureImportParamSet().GetTextureParamsDistinct().Select(x => x.SubAssetKey)); + importer.DrawRemapGUI(textureSetImporter.GetTextureImportParamSet().GetEnumerable().Select(x => x.SubAssetKey)); } if (GUILayout.Button("Clear")) diff --git a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/ScriptedImporterImpl.cs b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/ScriptedImporterImpl.cs index a10636d8c..f63a159a0 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/ScriptedImporterImpl.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/ScriptedImporterImpl.cs @@ -44,7 +44,7 @@ namespace UniGLTF using (var loader = new ImporterContext(parser, extractedObjects)) { // Configure TextureImporter to Extracted Textures. - foreach (var textureInfo in loader.TextureSetImporter.GetTextureImportParamSet().GetTextureParamsDistinct()) + foreach (var textureInfo in loader.TextureSetImporter.GetTextureImportParamSet().GetEnumerable()) { TextureImporterConfigurator.Configure(textureInfo, loader.TextureFactory.ExternalTextures); } diff --git a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/TextureExtractor.cs b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/TextureExtractor.cs index 70e5b9764..68c7cf818 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/TextureExtractor.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/TextureExtractor.cs @@ -80,7 +80,7 @@ namespace UniGLTF Action> onCompleted = null) { var extractor = new TextureExtractor(parser, textureDirectory, subAssets); - foreach (var param in textureSetImporter.GetTextureImportParamSet().GetTextureParamsDistinct()) + foreach (var param in textureSetImporter.GetTextureImportParamSet().GetEnumerable()) { extractor.Extract(param.SubAssetKey, param); } diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs index 99751dcde..59fdaa924 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs @@ -183,7 +183,7 @@ namespace UniGLTF public async Task LoadTexturesAsync() { - var textures = TextureSetImporter.GetTextureImportParamSet().GetTextureParamsDistinct(); + var textures = TextureSetImporter.GetTextureImportParamSet().GetEnumerable(); foreach (var param in textures) { var tex = await TextureFactory.GetTextureAsync(param); diff --git a/Assets/UniGLTF/Tests/UniGLTF/GltfLoadTests.cs b/Assets/UniGLTF/Tests/UniGLTF/GltfLoadTests.cs index ee30d42e2..4e942e723 100644 --- a/Assets/UniGLTF/Tests/UniGLTF/GltfLoadTests.cs +++ b/Assets/UniGLTF/Tests/UniGLTF/GltfLoadTests.cs @@ -136,7 +136,7 @@ namespace UniGLTF } // should unique - var gltfTextures = new GltfTextureSetImporter(parser).GetTextureParamsDistinct() + var gltfTextures = new GltfTextureSetImporter(parser).GetTextureImportParamSet().GetEnumerable() .Select(x => x.SubAssetKey) .ToArray(); var distinct = gltfTextures.Distinct().ToArray(); diff --git a/Assets/UniGLTF/Tests/UniGLTF/TextureEnumerateTests.cs b/Assets/UniGLTF/Tests/UniGLTF/TextureEnumerateTests.cs index 0fe344ccd..41113731d 100644 --- a/Assets/UniGLTF/Tests/UniGLTF/TextureEnumerateTests.cs +++ b/Assets/UniGLTF/Tests/UniGLTF/TextureEnumerateTests.cs @@ -207,7 +207,7 @@ namespace UniGLTF { GLTF = TwoTexture(), }; - var items = new GltfTextureSetImporter(parser).GetTextureParamsDistinct().ToArray(); + var items = new GltfTextureSetImporter(parser).GetTextureImportParamSet().GetEnumerable().ToArray(); Assert.AreEqual(2, items.Length); } @@ -216,7 +216,7 @@ namespace UniGLTF { GLTF = TwoTextureOneUri(), }; - var items = new GltfTextureSetImporter(parser).GetTextureParamsDistinct().ToArray(); + var items = new GltfTextureSetImporter(parser).GetTextureImportParamSet().GetEnumerable().ToArray(); Assert.AreEqual(1, items.Length); } @@ -225,7 +225,7 @@ namespace UniGLTF { GLTF = TwoTextureOneImage(), }; - var items = new GltfTextureSetImporter(parser).GetTextureParamsDistinct().ToArray(); + var items = new GltfTextureSetImporter(parser).GetTextureImportParamSet().GetEnumerable().ToArray(); Assert.AreEqual(1, items.Length); } @@ -234,7 +234,7 @@ namespace UniGLTF { GLTF = CombineMetallicSmoothOcclusion(), }; - var items = new GltfTextureSetImporter(parser).GetTextureParamsDistinct().ToArray(); + var items = new GltfTextureSetImporter(parser).GetTextureImportParamSet().GetEnumerable().ToArray(); Assert.AreEqual(1, items.Length); } } diff --git a/Assets/UniGLTF/Tests/UniGLTF/TextureTests.cs b/Assets/UniGLTF/Tests/UniGLTF/TextureTests.cs index 6f1ff0054..81c5ab449 100644 --- a/Assets/UniGLTF/Tests/UniGLTF/TextureTests.cs +++ b/Assets/UniGLTF/Tests/UniGLTF/TextureTests.cs @@ -96,7 +96,8 @@ namespace UniGLTF // extractor var extractor = new TextureExtractor(parser, UnityPath.FromUnityPath(""), context.TextureFactory.ConvertedTextures); - var m = context.TextureSetImporter.GetTextureParamsDistinct().FirstOrDefault(x => x.SubAssetKey.Name == "texture_1.standard"); + var m = context.TextureSetImporter.GetTextureImportParamSet().GetEnumerable() + .FirstOrDefault(x => x.SubAssetKey.Name == "texture_1.standard"); Assert.Catch(() => extractor.Extract(m.SubAssetKey, m)); } diff --git a/Assets/VRM/Editor/Format/VRMImporterMenu.cs b/Assets/VRM/Editor/Format/VRMImporterMenu.cs index faca0f0a1..2df161bbe 100644 --- a/Assets/VRM/Editor/Format/VRMImporterMenu.cs +++ b/Assets/VRM/Editor/Format/VRMImporterMenu.cs @@ -84,7 +84,7 @@ namespace VRM using (var context = new VRMImporterContext(parser, map)) { var editor = new VRMEditorImporterContext(context, prefabPath); - foreach (var textureInfo in editor.TextureSetImporter.GetTextureParamsDistinct()) + foreach (var textureInfo in editor.TextureSetImporter.GetTextureImportParamSet().GetEnumerable()) { VRMShaders.TextureImporterConfigurator.Configure(textureInfo, context.TextureFactory.ExternalTextures); } diff --git a/Assets/VRM/Editor/Format/vrmAssetPostprocessor.cs b/Assets/VRM/Editor/Format/vrmAssetPostprocessor.cs index c5a3f56b9..078d45d3d 100644 --- a/Assets/VRM/Editor/Format/vrmAssetPostprocessor.cs +++ b/Assets/VRM/Editor/Format/vrmAssetPostprocessor.cs @@ -59,7 +59,7 @@ namespace VRM using (var context = new VRMImporterContext(parser, map)) { var editor = new VRMEditorImporterContext(context, prefabPath); - foreach (var textureInfo in context.TextureSetImporter.GetTextureParamsDistinct()) + foreach (var textureInfo in context.TextureSetImporter.GetTextureImportParamSet().GetEnumerable()) { VRMShaders.TextureImporterConfigurator.Configure(textureInfo, context.TextureFactory.ExternalTextures); } diff --git a/Assets/VRM/Tests/VRMTextureEnumerateTests.cs b/Assets/VRM/Tests/VRMTextureEnumerateTests.cs index 9c812060f..aa4ad6311 100644 --- a/Assets/VRM/Tests/VRMTextureEnumerateTests.cs +++ b/Assets/VRM/Tests/VRMTextureEnumerateTests.cs @@ -72,7 +72,7 @@ namespace VRM }, } }; - var items = new VRMTextureSetImporter(parser, vrm).GetTextureParamsDistinct().ToArray(); + var items = new VRMTextureSetImporter(parser, vrm).GetTextureImportParamSet().GetEnumerable().ToArray(); Assert.AreEqual(1, items.Length); } } diff --git a/Assets/VRM10/Editor/ScriptedImporter/VrmScriptedImporterImpl.cs b/Assets/VRM10/Editor/ScriptedImporter/VrmScriptedImporterImpl.cs index 8222b36e1..91b513e00 100644 --- a/Assets/VRM10/Editor/ScriptedImporter/VrmScriptedImporterImpl.cs +++ b/Assets/VRM10/Editor/ScriptedImporter/VrmScriptedImporterImpl.cs @@ -101,7 +101,7 @@ namespace UniVRM10 using (var loader = new Vrm10Importer(parser, extractedObjects)) { // settings TextureImporters - foreach (var textureInfo in loader.TextureSetImporter.GetTextureParamsDistinct()) + foreach (var textureInfo in loader.TextureSetImporter.GetTextureImportParamSet().GetEnumerable()) { VRMShaders.TextureImporterConfigurator.Configure(textureInfo, loader.TextureFactory.ExternalTextures); } diff --git a/Assets/VRMShaders/GLTF/IO/Runtime/TextureImportParamSet.cs b/Assets/VRMShaders/GLTF/IO/Runtime/TextureImportParamSet.cs index d24a02149..f57778c7d 100644 --- a/Assets/VRMShaders/GLTF/IO/Runtime/TextureImportParamSet.cs +++ b/Assets/VRMShaders/GLTF/IO/Runtime/TextureImportParamSet.cs @@ -2,6 +2,9 @@ namespace VRMShaders { + /// + /// TextureImportParam の集合を Unique な集合にする。 + /// public sealed class TextureImportParamSet { private readonly Dictionary _params = new Dictionary(); @@ -13,7 +16,7 @@ namespace VRMShaders _params.Add(param.SubAssetKey, param); } - public IEnumerable GetTextureParamsDistinct() + public IEnumerable GetEnumerable() { foreach (var kv in _params) {