Launch场景增加加载LaunchPanel逻辑
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user