当前类型仅一个模块的时候自动进入 不需要模块选择页面
This commit is contained in:
parent
9c1f082194
commit
d6fa77d75b
@ -34,6 +34,8 @@ namespace QFramework.Example
|
||||
protected override void OnOpen(IUIData uiData = null)
|
||||
{
|
||||
Content.RemoveAllChildren();
|
||||
int moduleCount = 0;
|
||||
int lastIndex = 0;
|
||||
for (int i = 0; i < Global.Instance.appData.Modules.Count; i++)
|
||||
{
|
||||
var item = Global.Instance.appData.Modules[i];
|
||||
@ -42,6 +44,7 @@ namespace QFramework.Example
|
||||
|
||||
if (curType == Global.appTpe || curType == Global.AppType.All)
|
||||
{
|
||||
moduleCount++;
|
||||
int index = i;
|
||||
GameObject obj = GameObject.Instantiate(BtnItem.gameObject, Content);
|
||||
obj.transform.Find("Label").GetComponent<TextMeshProUGUI>().text = item.ModuleName;
|
||||
@ -54,10 +57,23 @@ namespace QFramework.Example
|
||||
SceneManager.sceneLoaded += OnLoadFinished;
|
||||
});
|
||||
});
|
||||
lastIndex = index;
|
||||
}
|
||||
}
|
||||
|
||||
Debug.LogError(Global.Instance.appData.Modules.Count);
|
||||
if (moduleCount == 1)
|
||||
{
|
||||
Global.Instance.curModule = Global.Instance.appData.Modules[lastIndex];
|
||||
UIKit.OpenPanelAsync<UILoading>(canvasLevel: UILevel.PopUI).ToAction().StartGlobal(() =>
|
||||
{
|
||||
SceneManager.LoadSceneAsync(Global.Instance.curModule.Scene, LoadSceneMode.Single);
|
||||
SceneManager.sceneLoaded += OnLoadFinished;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user