This commit is contained in:
Masataka SUMI
2021-05-27 15:16:03 +09:00
parent b549f54a13
commit 86d1dc0db7
10 changed files with 24 additions and 24 deletions

View File

@@ -56,7 +56,7 @@ namespace UniGLTF
s_foldTextures = EditorGUILayout.Foldout(s_foldTextures, "Remapped Textures");
if (s_foldTextures)
{
importer.DrawRemapGUI<UnityEngine.Texture>(textureSetImporter.GetTextureSet().GetTextureParamsDistinct().Select(x => x.SubAssetKey));
importer.DrawRemapGUI<UnityEngine.Texture>(textureSetImporter.GetTextureImportParamSet().GetTextureParamsDistinct().Select(x => x.SubAssetKey));
}
if (GUILayout.Button("Clear"))

View File

@@ -44,7 +44,7 @@ namespace UniGLTF
using (var loader = new ImporterContext(parser, extractedObjects))
{
// Configure TextureImporter to Extracted Textures.
foreach (var textureInfo in loader.TextureSetImporter.GetTextureSet().GetTextureParamsDistinct())
foreach (var textureInfo in loader.TextureSetImporter.GetTextureImportParamSet().GetTextureParamsDistinct())
{
TextureImporterConfigurator.Configure(textureInfo, loader.TextureFactory.ExternalTextures);
}

View File

@@ -80,7 +80,7 @@ namespace UniGLTF
Action<IEnumerable<UnityPath>> onCompleted = null)
{
var extractor = new TextureExtractor(parser, textureDirectory, subAssets);
foreach (var param in textureSetImporter.GetTextureSet().GetTextureParamsDistinct())
foreach (var param in textureSetImporter.GetTextureImportParamSet().GetTextureParamsDistinct())
{
extractor.Extract(param.SubAssetKey, param);
}

View File

@@ -183,7 +183,7 @@ namespace UniGLTF
public async Task LoadTexturesAsync()
{
var textures = TextureSetImporter.GetTextureSet().GetTextureParamsDistinct();
var textures = TextureSetImporter.GetTextureImportParamSet().GetTextureParamsDistinct();
foreach (var param in textures)
{
var tex = await TextureFactory.GetTextureAsync(param);

View File

@@ -28,24 +28,24 @@ namespace UniGLTF
public sealed class GltfTextureSetImporter : ITextureSetImporter
{
private readonly GltfParser m_parser;
private TextureSet _textureSet;
private TextureImportParamSet _textureImportParamSet;
public GltfTextureSetImporter(GltfParser parser)
{
m_parser = parser;
}
public TextureSet GetTextureSet()
public TextureImportParamSet GetTextureImportParamSet()
{
if (_textureSet == null)
if (_textureImportParamSet == null)
{
_textureSet = new TextureSet();
_textureImportParamSet = new TextureImportParamSet();
foreach (var (_, param) in EnumerateAllTextures(m_parser))
{
_textureSet.Add(param);
_textureImportParamSet.Add(param);
}
}
return _textureSet;
return _textureImportParamSet;
}
/// <summary>

View File

@@ -9,6 +9,6 @@ namespace UniGLTF
/// </summary>
public interface ITextureSetImporter
{
TextureSet GetTextureSet();
TextureImportParamSet GetTextureImportParamSet();
}
}

View File

@@ -10,7 +10,7 @@ namespace VRM
{
private readonly GltfParser m_parser;
private readonly glTF_VRM_extensions m_vrm;
private TextureSet _textureSet;
private TextureImportParamSet _textureImportParamSet;
public VRMTextureSetImporter(GltfParser parser, glTF_VRM_extensions vrm)
{
@@ -18,17 +18,17 @@ namespace VRM
m_vrm = vrm;
}
public TextureSet GetTextureSet()
public TextureImportParamSet GetTextureImportParamSet()
{
if (_textureSet == null)
if (_textureImportParamSet == null)
{
_textureSet = new TextureSet();
_textureImportParamSet = new TextureImportParamSet();
foreach (var (_, param) in EnumerateAllTextures(m_parser, m_vrm))
{
_textureSet.Add(param);
_textureImportParamSet.Add(param);
}
}
return _textureSet;
return _textureImportParamSet;
}

View File

@@ -10,24 +10,24 @@ namespace UniVRM10
public sealed class Vrm10TextureSetImporter : ITextureSetImporter
{
private readonly GltfParser m_parser;
private TextureSet _textureSet;
private TextureImportParamSet _textureImportParamSet;
public Vrm10TextureSetImporter(GltfParser parser)
{
m_parser = parser;
}
public TextureSet GetTextureSet()
public TextureImportParamSet GetTextureImportParamSet()
{
if (_textureSet == null)
if (_textureImportParamSet == null)
{
_textureSet = new TextureSet();
_textureImportParamSet = new TextureImportParamSet();
foreach (var (_, param) in EnumerateAllTextures(m_parser))
{
_textureSet.Add(param);
_textureImportParamSet.Add(param);
}
}
return _textureSet;
return _textureImportParamSet;
}
/// <summary>

View File

@@ -2,7 +2,7 @@
namespace VRMShaders
{
public sealed class TextureSet
public sealed class TextureImportParamSet
{
private readonly Dictionary<SubAssetKey, TextureImportParam> _params = new Dictionary<SubAssetKey, TextureImportParam>();