123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- /// #pkgName FGUI包名
- /// #panelName UIPanel名字
- /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
- /// 该脚本由模板创建
- /// created by cb 2024
- using XGame.Framework.UI;
- namespace FL.FGUI
- {
- /// <summary>
- /// UI逻辑处理类
- /// </summary>
- /// <typeparam name=""></typeparam>
- public partial class PartnerSbBagPanelCtrl : UIController<PartnerSbBagPanelVM>
- {
- protected override void OnDisable()
- {
- RemoveUIListenres();
- VM.SbBagNested.Disable();
- VM.MwBagNested.Disable();
- }
- protected override void OnEnable(object intent)
- {
- AddUIListenres();
- _page = (int)intent;
- ShowUI();
- }
- private void AddUIListenres()
- {
- VM.SbBagBtn.onClick.Add(OnClickSbBagBtn);
- VM.MwBagBtn.onClick.Add(OnClickMwBagBtn);
- }
- private void RemoveUIListenres()
- {
- VM.SbBagBtn.onClick.Remove(OnClickSbBagBtn);
- VM.MwBagBtn.onClick.Remove(OnClickMwBagBtn);
- }
- private void OnClickSbBagBtn()
- {
- _page = 0;
- ShowUI();
- }
- private void OnClickMwBagBtn()
- {
- _page = 1;
- ShowUI();
- }
- private int _page;
- private void ShowUI()
- {
- VM.Page.selectedIndex = _page;
- if (_page == 0)
- {
- VM.SbBagNested.Enable(null);
- VM.MwBagNested.Disable();
- }
- else
- {
- VM.MwBagNested.Enable(null);
- VM.SbBagNested.Disable();
- }
- }
- }
- }
|