mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-12 05:24:14 -05:00
fix_virtual func
This commit is contained in:
parent
8c821dc941
commit
0bba0601d5
|
|
@ -394,7 +394,7 @@ namespace UniGLTF
|
|||
Root.name = Path.GetFileNameWithoutExtension(path);
|
||||
}
|
||||
|
||||
public static ITextureLoader CreateTextureLoader(int index)
|
||||
public virtual ITextureLoader CreateTextureLoader(int index)
|
||||
{
|
||||
#if UNIGLTF_USE_WEBREQUEST_TEXTURELOADER
|
||||
return new UnityWebRequestTextureLoader(index);
|
||||
|
|
@ -403,7 +403,7 @@ namespace UniGLTF
|
|||
#endif
|
||||
}
|
||||
|
||||
public virtual void CreateTextureItems(UnityPath imageBaseDir = default(UnityPath))
|
||||
public void CreateTextureItems(UnityPath imageBaseDir = default(UnityPath))
|
||||
{
|
||||
if (m_textures.Any())
|
||||
{
|
||||
|
|
@ -431,7 +431,7 @@ namespace UniGLTF
|
|||
else
|
||||
#endif
|
||||
{
|
||||
item = new TextureItem(i, CreateTextureLoader);
|
||||
item = new TextureItem(i, CreateTextureLoader(i));
|
||||
}
|
||||
|
||||
AddTexture(item);
|
||||
|
|
|
|||
|
|
@ -110,10 +110,15 @@ namespace UniGLTF
|
|||
/// Texture from buffer
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
public TextureItem(int index, Func<int, ITextureLoader> textureLoaderFactrory)
|
||||
public TextureItem(int index, ITextureLoader textureLoader)
|
||||
{
|
||||
m_textureIndex = index;
|
||||
m_textureLoader = textureLoaderFactrory(index);
|
||||
m_textureLoader = textureLoader;
|
||||
|
||||
if(m_textureLoader == null)
|
||||
{
|
||||
throw new Exception("ITextureLoader is null.");
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ namespace VRM
|
|||
// 作成する(先行ロード用)
|
||||
if (gltfMeta.texture >= 0 && gltfMeta.texture < GLTF.textures.Count)
|
||||
{
|
||||
var t = new TextureItem(gltfMeta.texture, CreateTextureLoader);
|
||||
var t = new TextureItem(gltfMeta.texture, CreateTextureLoader(gltfMeta.texture));
|
||||
t.Process(GLTF, Storage);
|
||||
meta.Thumbnail = t.Texture;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user