protected virtual IEnumerator LoadContent(DownloadHandler dlh) { deferAgent.Reset(); gLTFastInstance = new GLTFast(); bool allFine = true; LoadContentPrimary(dlh); allFine = !gLTFastInstance.LoadingError; if (allFine) { if (deferAgent.ShouldDefer()) { yield return(null); } var routineBuffers = StartCoroutine(gLTFastInstance.WaitForBufferDownloads()); var routineTextures = StartCoroutine(gLTFastInstance.WaitForTextureDownloads()); yield return(routineBuffers); yield return(routineTextures); } allFine = !gLTFastInstance.LoadingError; if (allFine) { deferAgent.Reset(); var prepareRoutine = gLTFastInstance.Prepare(); while (prepareRoutine.MoveNext()) { allFine = !gLTFastInstance.LoadingError; if (!allFine) { break; } if (deferAgent.ShouldDefer()) { yield return(null); } } } allFine = !gLTFastInstance.LoadingError; if (allFine) { if (deferAgent.ShouldDefer()) { yield return(null); } allFine = gLTFastInstance.InstanciateGltf(transform); } if (onLoadComplete != null) { onLoadComplete(allFine, frame); } }