mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-28 05:44:48 -05:00
new AssetTextureLoader
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user