From 08b87b162a0c32527e79d74e672702c96edc33a9 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 27 Sep 2018 02:00:05 +0900 Subject: [PATCH] Removed show argument from ImporterContext --- Scripts/Format/VRMImporter.cs | 20 ++++++++++++++++++-- Scripts/Format/VRMImporterContext.cs | 11 ++--------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Scripts/Format/VRMImporter.cs b/Scripts/Format/VRMImporter.cs index 9950b3512..ac8fe5301 100644 --- a/Scripts/Format/VRMImporter.cs +++ b/Scripts/Format/VRMImporter.cs @@ -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 onLoaded, Action onError = null, bool show = true) { - context.LoadAsync(onLoaded, onError, show); + context.LoadAsync(_ => + { + if (show) + { + context.ShowMeshes(); + } + onLoaded(context.Root); + }, + onError); } #endregion diff --git a/Scripts/Format/VRMImporterContext.cs b/Scripts/Format/VRMImporterContext.cs index 510aeceee..b4db38236 100644 --- a/Scripts/Format/VRMImporterContext.cs +++ b/Scripts/Format/VRMImporterContext.cs @@ -39,7 +39,7 @@ namespace VRM OnLoadModel(); } - protected override Schedulable LoadAsync(bool show) + protected override Schedulable 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() {