| | |
| | | // 初始化各层级的Transform
|
| | | staticTrans = uiRoot.Find("Static");
|
| | | bottomTrans = uiRoot.Find("Bottom");
|
| | | midTrans = uiRoot.Find("Mid");
|
| | | midTrans = uiRoot.Find("Middle");
|
| | | topTrans = uiRoot.Find("Top");
|
| | | systemTrans = uiRoot.Find("System");
|
| | |
|
| | |
| | |
|
| | | uiObject.transform.SetParent(parentTrans, false);
|
| | |
|
| | | // Debug.LogError("加载UI资源-SetParent " + uiName + " transName is " + parentTrans.gameObject.name);
|
| | |
|
| | | // 设置排序顺序
|
| | | int baseSortingOrder = GetBaseSortingOrderForLayer(uiBase.uiLayer);
|
| | | uiBase.SetSortingOrder(baseSortingOrder);
|
| | |
| | | {
|
| | | // 获取UI类型名称
|
| | | string uiName = typeof(T).Name;
|
| | | |
| | | |
| | | // Debug.LogError("打开ui " + uiName);
|
| | |
|
| | |
|
| | | // 加载UI资源
|
| | | T ui = LoadUIResource<T>(uiName);
|
| | | if (ui == null)
|
| | |
| | | Debug.LogError($"打开UI失败: {uiName}");
|
| | | return null;
|
| | | }
|
| | |
|
| | | // Debug.LogError("加载UI资源 " + uiName);
|
| | |
|
| | | // 自动设置父级UI(如果未指定且支持父子关系)
|
| | | if (parentUI == null && ui.supportParentChildRelation && uiStack.Count > 0)
|