| | |
| | | |
| | | private UIBase LoadUIResource(string uiName) |
| | | { |
| | | |
| | | // 从资源管理器加载UI预制体 |
| | | GameObject prefab = ResManager.Instance.LoadAsset<GameObject>("UI", uiName); |
| | | GameObject prefab; |
| | | if (uiName == "LaunchWin") |
| | | { |
| | | prefab = BuiltInLoader.LoadPrefab(uiName); |
| | | } |
| | | else |
| | | { |
| | | prefab = ResManager.Instance.LoadAsset<GameObject>("UI", uiName); |
| | | } |
| | | |
| | | // 检查预制体是否加载成功 |
| | | if (prefab == null) |
| | |
| | | } |
| | | // 添加到UI列表 |
| | | uiDict[uiName].Add(returnValue); |
| | | |
| | | |
| | | #if UNITY_EDITOR |
| | | if (uiDict[uiName].Count > 5) |
| | | { |
| | | Debug.LogError("已打开" + uiDict[uiName].Count + "个界面:" + uiName); |
| | | } |
| | | #endif |
| | | |
| | | // 将UI添加到栈中 |
| | | uiStack.Push(returnValue); |
| | | |