new AssetTextureLoader

This commit is contained in:
ousttrue
2021-02-10 22:08:35 +09:00
parent d2fd56ef51
commit 92138a80ff
2 changed files with 6 additions and 18 deletions

View File

@@ -87,7 +87,7 @@ namespace UniGLTF
public bool IsAsset
{
private set;
set;
get;
}
@@ -115,27 +115,12 @@ namespace UniGLTF
m_textureIndex = index;
m_textureLoader = textureLoader;
if(m_textureLoader == null)
if (m_textureLoader == null)
{
throw new Exception("ITextureLoader is null.");
}
}
#if UNITY_EDITOR
/// <summary>
/// Texture from asset
/// </summary>
/// <param name="index"></param>
/// <param name="assetPath"></param>
/// <param name="textureName"></param>
public TextureItem(int index, UnityPath assetPath, string textureName)
{
m_textureIndex = index;
IsAsset = true;
m_textureLoader = new AssetTextureLoader(assetPath, textureName);
}
#endif
#region Process
ITextureLoader m_textureLoader;

View File

@@ -121,7 +121,10 @@ namespace UniGLTF
///
var assetPath = imageBaseDir.Child(image.uri);
var textureName = !string.IsNullOrEmpty(image.name) ? image.name : Path.GetFileNameWithoutExtension(image.uri);
item = new TextureItem(i, assetPath, textureName);
item = new TextureItem(i, new AssetTextureLoader(assetPath, textureName))
{
IsAsset = true
};
}
else
#endif