Health/Assets/Scripts/UI/UILoadConfig.cs

33 lines
1.1 KiB
C#
Raw Normal View History

2023-11-07 13:55:35 +00:00
using System;
using System.Collections.Generic;
public static class UILoadConfig
{
private static readonly Dictionary<string, string> _panelPathes = new Dictionary<string, string>()
{
2023-11-14 18:01:23 +00:00
{ "SplashUI" , "UI/SplashUI" },
2023-11-07 13:55:35 +00:00
{ "MainUIPanel" , "UI/MainUI" },
{ "StartPanel" , "UI/StartPanel" },
{ "PlanSelectPopup" , "UI/Popup" },
{ "UserSettingPanel" , "UI/UserSetting" },
{ "ActionListUIPanel" , "UI/ActionListUI" },
{ "ActionGuideVideoPanel" , "UI/ActionGuideVideoPanel" },
{ "GuideUI" , "UI/GuideUI" },
2023-11-07 15:28:19 +00:00
{ "ClearingSettlementUI" , "UI/ClearingSettlementUI" },
2023-11-14 17:01:48 +00:00
{ "HudUI" , "UI/HUDRoot" },
2023-11-19 17:45:25 +00:00
{ "MeditationVideoUI" , "UI/MeditationVideoPanel" },
2023-11-20 01:56:30 +00:00
{ "FaceDetectUI" , "UI/FaceDetectUI" },
{ "TestUI" , "UI/TestUI" },
2023-11-07 13:55:35 +00:00
};
public static string GetPath(string typeName)
{
//从配置文件中读取
if (!_panelPathes.TryGetValue(typeName, out var path))
{
throw new Exception($"Panel {typeName} not found");
}
return path;
}
}