From 421a072c7fd0270525f861fd8b347861dffe0526 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Thu, 19 Dec 2024 11:52:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A9=BA=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Launch.cs | 5 ++++- Assets/Scripts/Xml/XmlParser.cs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Launch.cs b/Assets/Scripts/Launch.cs index 7521b905..26bdd4d2 100644 --- a/Assets/Scripts/Launch.cs +++ b/Assets/Scripts/Launch.cs @@ -39,7 +39,10 @@ public class Launch : MonoBehaviour yield return UIKit.OpenPanelAsync(); yield return new WaitUntil(() => isLoadFinished == true); - yield return ActionHelper.GetActionAndSub(Global.Instance.appData.preLoad.action).Start(this); + if (Global.Instance.appData.preLoad != null && Global.Instance.appData.preLoad.action != null) + { + yield return ActionHelper.GetActionAndSub(Global.Instance.appData.preLoad.action).Start(this); + } yield return UIKit.OpenPanelAsync(); UIKit.HidePanel(); diff --git a/Assets/Scripts/Xml/XmlParser.cs b/Assets/Scripts/Xml/XmlParser.cs index 1e664b5e..7a0a7eb2 100644 --- a/Assets/Scripts/Xml/XmlParser.cs +++ b/Assets/Scripts/Xml/XmlParser.cs @@ -134,7 +134,6 @@ namespace XMLTool // ʼAppData AppData appData = new AppData { - preLoad = new PreLoad(), Modules = new List(), }; @@ -143,6 +142,7 @@ namespace XMLTool var preLoadElement = appDataElement.Element("PreLoad"); if (preLoadElement!=null) { + appData.preLoad = new PreLoad(); foreach (XElement actionElement in preLoadElement.Elements("Action")) { var action = ParseAction(actionElement);