YanCheng_Metrology/Assets/Scripts/Project/UI/UI_Panel/UI_SelectModePanel.cs

41 lines
1.0 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UI_SelectModePanel : BasePanel
{
/// <summary>
/// 初始化
/// </summary>
public void Init()
{
}
/// <summary>
/// 按钮点击
/// </summary>
/// <param name="btnName"></param>
protected override void OnClick(string btnName)
{
var modeType = E_ModeType.None;
switch (btnName)
{
case "StudyModelBtn":
modeType = E_ModeType.Study;
break;
case "TrainModelBtn":
modeType = E_ModeType.Practice;
break;
}
GameManager.StudyOrPracticeMgr.ModeType = modeType;
GameManager.EventMgr.EventTrigger(Enum_EventType.SwitchMode);
GameManager.UIMgr.ShowPanel<UI_SelectDevicePanel>(E_UI_Layer.Mid, (panel) =>
{
panel.Init();
GameManager.UIMgr.HidePanel<UI_SelectModePanel>();//TODO 框架中设计一个SelfClose()感觉更好
});
}
}