Update UniGLTF

This commit is contained in:
ousttrue
2018-05-25 17:29:58 +09:00
parent 689fbe3ca9
commit 11304b71d5
2 changed files with 10 additions and 4 deletions

View File

@@ -456,9 +456,10 @@ namespace VRM
#region LoadVrmAsync
static IEnumerator LoadTextures(VRMImporterContext context)
{
foreach (var gltfTexture in context.GLTF.textures)
for(int i=0; i<context.GLTF.textures.Count; ++i)
{
var x = UniGLTF.gltfImporter.ImportTexture(context.GLTF, gltfTexture.source);
var x = new TextureItem(context.GLTF, i);
x.Process();
context.Textures.Add(x);
yield return null;
}
@@ -573,7 +574,12 @@ namespace VRM
{
var index = i;
parent.AddTask(Scheduler.MainThread,
() => gltfImporter.ImportTexture(ctx.GLTF, index))
() =>
{
var texture = new TextureItem(ctx.GLTF, index);
texture.Process();
return texture;
})
.ContinueWith(Scheduler.ThreadPool, x => ctx.Textures.Add(x));
}
})