Launch场景增加加载LaunchPanel逻辑

This commit is contained in:
Wurui
2025-11-08 11:29:36 +08:00
parent 421cbad8db
commit 49022f8626
10 changed files with 315 additions and 10 deletions

View File

@@ -9,7 +9,7 @@ namespace A2W
{
public class UIManager : Singleton<UIManager>
{
public const string panel_prefabs_dir_path = "Assets/Gameplay/Prefabs/UIPanel/"; // UI面板预制体目录
public const string panel_prefabs_dir_path = "UIPanel/"; // UI面板预制体目录
// 这里保存IUIPanel的list
List<UIPanel> panels;
@@ -63,7 +63,8 @@ namespace A2W
public async UniTask<T> InitPanel<T>() where T : UIPanel
{
// 在这里加载对应panel的预制体
T panel = (T)await Resources.LoadAsync<T>(GetPanelPath<T>());
var perfab = await Resources.LoadAsync<T>(GetPanelPath<T>());
T panel = (T)Instantiate(perfab);
// 加载完了以后存在panels里
if (panel != null)
@@ -80,7 +81,8 @@ namespace A2W
public async UniTask<T> InitPanel<T>(string path) where T : UIPanel
{
// 在这里加载对应panel的预制体
T panel = (T)await Resources.LoadAsync<T>(GetPanelPath<T>());
var perfab = await Resources.LoadAsync<T>(GetPanelPath<T>());
T panel = (T)Instantiate(perfab);
// 加载完了以后存在panels里
if (panel != null)