From 17e1661b0c9fda1aa58ad6ee866a1927a9bda7d9 Mon Sep 17 00:00:00 2001 From: MaZiFAU <63099053+MaZiFAU@users.noreply.github.com> Date: Thu, 6 Jul 2023 00:03:20 +0200 Subject: [PATCH] More Robust StageLoading, Catching Exceptions --- Assets/Scripts/Loading/Stage.cs | 12 ++++++++++-- Assets/Stages/CanonBall A.JSON.meta | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Loading/Stage.cs b/Assets/Scripts/Loading/Stage.cs index 33af000e..33bb52e6 100644 --- a/Assets/Scripts/Loading/Stage.cs +++ b/Assets/Scripts/Loading/Stage.cs @@ -416,8 +416,16 @@ public static Dictionary<string, Stage> Grup(List<Directories> hierarchie = null if (file.Extension != ".JSON") continue; - if (ShallowLoad(out Stage tmp, file.FullName)) - ret.Add(tmp.name, tmp); + try + { + if (ShallowLoad(out Stage tmp, file.FullName)) + ret.Add(tmp.name, tmp); + } + catch (Exception ex) + { + Debug.LogError("Could not load StageFile: " + file.FullName); + Debug.LogException(ex); + } } return ret; diff --git a/Assets/Stages/CanonBall A.JSON.meta b/Assets/Stages/CanonBall A.JSON.meta index 8c4f2ddb..a0d2e1ae 100644 --- a/Assets/Stages/CanonBall A.JSON.meta +++ b/Assets/Stages/CanonBall A.JSON.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9e6f77486fb9c93489d4fb803ade1379 +guid: db4a88d3caba4a8499fdb182c8187a06 TextScriptImporter: externalObjects: {} userData: -- GitLab