Removed show argument from ImporterContext

This commit is contained in:
ousttrue
2018-09-27 02:00:05 +09:00
parent 4a6c0a17d7
commit 08b87b162a
2 changed files with 20 additions and 11 deletions

View File

@@ -56,13 +56,29 @@ namespace VRM
{
context.ParseGlb(bytes);
}
context.LoadAsync(onLoaded, onError, show);
context.LoadAsync(_ =>
{
if (show)
{
context.ShowMeshes();
}
onLoaded(context.Root);
},
onError);
}
[Obsolete("use VVRMImporterContext.LoadAsync")]
public static void LoadVrmAsync(VRMImporterContext context, Action<GameObject> onLoaded, Action<Exception> onError = null, bool show = true)
{
context.LoadAsync(onLoaded, onError, show);
context.LoadAsync(_ =>
{
if (show)
{
context.ShowMeshes();
}
onLoaded(context.Root);
},
onError);
}
#endregion

View File

@@ -39,7 +39,7 @@ namespace VRM
OnLoadModel();
}
protected override Schedulable<GameObject> LoadAsync(bool show)
protected override Schedulable<Unit> LoadAsync()
{
return Schedulable.Create()
.AddTask(Scheduler.ThreadPool, () =>
@@ -129,17 +129,10 @@ namespace VRM
{
Root.name = "VRM";
Debug.Log(GetSpeedLog());
if (show)
{
ShowMeshes();
}
return Root;
return Unit.Default;
});
}
#region OnLoad
void OnLoadModel()
{