2025-09-08 17:37:12 +08:00

40 lines
1.4 KiB
C#

using ZXKFramework;
using Button = UnityEngine.UI.Button;
using UnityEngine;
namespace DongWuYiXue.Main
{
public class PatternPanel : UIBase
{
public override string GroupName => "PatternPanel";
public override string Name => "PatternPanel";
Button sjPattern_Btn;
Button khPattern_Btn;
Button jxPattern_Btn;
GameModel gameModel;
public override void Init(IUIManager uictrl)
{
base.Init(uictrl);
gameModel = GetModel<GameModel>();
jxPattern_Btn = transform.FindFirst("jxPattern_Btn").GetComponent<Button>();
sjPattern_Btn = transform.FindFirst("sjPattern_Btn").GetComponent<Button>();
khPattern_Btn = transform.FindFirst("khPattern_Btn").GetComponent<Button>();
sjPattern_Btn.onClick.AddListener(() =>
{
gameModel.modeType = ModeType.ShiXun;
Game.Instance.fsm.ChangeState<GameLoadingState>();
});
khPattern_Btn.onClick.AddListener(() =>
{
gameModel.modeType = ModeType.KaoHe;
Game.Instance.fsm.ChangeState<GameLoadingState>();
});
jxPattern_Btn.onClick.AddListener(() =>
{
gameModel.modeType = ModeType.JiaoXue;
Game.Instance.fsm.ChangeState<GameLoadingState>();
});
}
}
}