module支持有序加载
This commit is contained in:
parent
f54e479c9b
commit
ee4c50c696
@ -58,10 +58,15 @@ namespace QFramework
|
|||||||
XDocument doc = XDocument.Parse(xmlStr);
|
XDocument doc = XDocument.Parse(xmlStr);
|
||||||
// »ñÈ¡¸ùÔªËØ
|
// »ñÈ¡¸ùÔªËØ
|
||||||
XElement moduleXml = doc.Root;
|
XElement moduleXml = doc.Root;
|
||||||
Global.moduleDict.Add(index, moduleXml);
|
if (string.IsNullOrEmpty(index))
|
||||||
|
{
|
||||||
// 直接加载会导致无序
|
// ÎÞÐò¼ÓÔØ
|
||||||
//XmlParser.LoadModule(moduleXml, Global.Instance.appData);
|
XmlParser.LoadModule(moduleXml, Global.Instance.appData);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Global.moduleDict.Add(index, moduleXml);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -41,19 +41,21 @@ public class Launch : MonoBehaviour
|
|||||||
yield return new WaitUntil(() => isLoadFinished == true);
|
yield return new WaitUntil(() => isLoadFinished == true);
|
||||||
if (Global.Instance.appData.preLoad != null && Global.Instance.appData.preLoad.action != null)
|
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 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))
|
if (Global.moduleDict.Count > 0)
|
||||||
{
|
{
|
||||||
XmlParser.LoadModule(Global.moduleDict[index], Global.Instance.appData);
|
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<UIModeSelect>();
|
yield return UIKit.OpenPanelAsync<UIModeSelect>();
|
||||||
UIKit.HidePanel<UILoading>();
|
UIKit.HidePanel<UILoading>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user