onloadmodel to return ienumerator

This commit is contained in:
hiroj 2020-03-31 17:48:18 +09:00
parent ce1c6b4646
commit 172dce1d20
2 changed files with 11 additions and 4 deletions

View File

@ -586,10 +586,10 @@ namespace UniGLTF
AnimationImporter.ImportAnimation(this);
}
})
.ContinueWithCoroutine(Scheduler.MainThread, OnLoadModel)
.ContinueWith(Scheduler.CurrentThread,
_ =>
{
OnLoadModel();
if (m_showSpeedLog)
{
Debug.Log(GetSpeedLog());
@ -598,9 +598,10 @@ namespace UniGLTF
});
}
protected virtual void OnLoadModel()
protected virtual IEnumerator OnLoadModel()
{
Root.name = "GLTF";
yield break;
}
IEnumerator TexturesProcessOnAnyThread()

View File

@ -4,7 +4,7 @@ using System.Collections.Generic;
using UniGLTF;
using UnityEngine;
using System.IO;
using System.Collections;
namespace VRM
{
@ -39,7 +39,7 @@ namespace VRM
}
#region OnLoad
protected override void OnLoadModel()
protected override IEnumerator OnLoadModel()
{
Root.name = "VRM";
@ -47,21 +47,27 @@ namespace VRM
{
LoadMeta();
}
yield return null;
using (MeasureTime("VRM LoadHumanoid"))
{
LoadHumanoid();
}
yield return null;
using (MeasureTime("VRM LoadBlendShapeMaster"))
{
LoadBlendShapeMaster();
}
yield return null;
using (MeasureTime("VRM LoadSecondary"))
{
VRMSpringUtility.LoadSecondary(Root.transform, Nodes,
GLTF.extensions.VRM.secondaryAnimation);
}
yield return null;
using (MeasureTime("VRM LoadFirstPerson"))
{
LoadFirstPerson();