using FlappyBird; using QAssetBundle; using QFramework; using QFramework.Example; using System.Collections; using UnityEngine; using XMLTool; public class Launch : MonoBehaviour { ResLoader loader; private void Awake() { loader = ResLoader.Allocate(); StartCoroutine(StartApp()); #if VR Utility.FindObj("FlyCamera")?.SetActive(false); #endif } IEnumerator StartApp() { yield return ResKit.InitAsync(); bool isLoadFinished = false; loader.Add2Load(Global.appXmlPath.ToLocalTextResName(), (success, res) => { if (success) { Global.Instance.appData = XmlParser.ParseXml(res.As().text); } }); loader.LoadAsync(() => { isLoadFinished = true; ActionKit.Delay(2f, () => { loader.Recycle2Cache(); loader = null; }); }); yield return UIKit.OpenPanelAsync(); yield return new WaitUntil(() => isLoadFinished == true); if (Global.Instance.appData.preLoad != null && Global.Instance.appData.preLoad.action != null) { yield return ActionHelper.GetActionAndSub(Global.Instance.appData.preLoad.action).Start(this, () => { // 暂时放在这里 if (Global.moduleDict.Count > 0) { for (int i = 0; i < Global.moduleDict.Count; i++) { string index = (i + 1).ToString(); if (Global.moduleDict.ContainsKey(index)) { XmlParser.LoadModule(Global.moduleDict[index], Global.Instance.appData); } } } }); } yield return UIKit.OpenPanelAsync(); UIKit.HidePanel(); // 暂时不用 //foreach (var item in Global.Instance.appData.ActionDict) //{ // var act = ActionHelper.GetAction(item.Value); // act.Start(this, () => Debug.LogError("完成。。。")); //} } }