1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- /// #pkgName FGUI包名
- /// #panelName UIPanel名字
- /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
- /// 该脚本由模板创建
- /// created by cb 2024
- using FairyGUI;
- using XGame.Framework.UI;
- namespace FL.FGUI
- {
- /// <summary>
- /// UI逻辑处理类
- /// </summary>
- /// <typeparam name=""></typeparam>
- public partial class MainHomePanelCtrl : UIController<MainHomePanelVM>
- {
- protected override void OnEnable(object intent)
- {
- AddUIListenres();
- }
- protected override void OnDisable()
- {
- RemoveUIListenres();
- }
- #region UI事件
- private void AddUIListenres()
- {
- VM.GoldBtn.onClick.Add(OnClickGoldBtn);
- VM.DiamondBtn.onClick.Add(OnClickDiamondBtn);
- VM.ShopBtn.onClick.Add(OnClickShopBtn);
- VM.SCBtn.onClick.Add(OnClickSCBtn);
- VM.HDBtn.onClick.Add(OnClickHDBtn);
- VM.XSLBtn.onClick.Add(OnClickXSLBtn);
- VM.GoldBox.onClick.Add(OnClickGoldBox);
- VM.TaskBtn.onClick.Add(OnClickTaskBtn);
- VM.XinXiBtn.onClick.Add(OnClickXinXiBtn);
- VM.SheZhiBtn.onClick.Add(OnClickSheZhiBtn);
- }
- private void RemoveUIListenres()
- {
- VM.GoldBtn.onClick.Remove(OnClickGoldBtn);
- VM.DiamondBtn.onClick.Remove(OnClickDiamondBtn);
- VM.ShopBtn.onClick.Remove(OnClickShopBtn);
- VM.SCBtn.onClick.Remove(OnClickSCBtn);
- VM.HDBtn.onClick.Remove(OnClickHDBtn);
- VM.XSLBtn.onClick.Remove(OnClickXSLBtn);
- VM.GoldBox.onClick.Remove(OnClickGoldBox);
- VM.TaskBtn.onClick.Remove(OnClickTaskBtn);
- VM.XinXiBtn.onClick.Remove(OnClickXinXiBtn);
- VM.SheZhiBtn.onClick.Remove(OnClickSheZhiBtn);
- }
- private void OnClickGoldBtn(EventContext context)
- {
- EventSingle.Instance.Notify(EventDefine.ShowTips, "OnClickGoldBtn");
- }
- private void OnClickDiamondBtn(EventContext context)
- {
- EventSingle.Instance.Notify(EventDefine.ShowTips, "OnClickDiamondBtn");
- }
- private void OnClickShopBtn(EventContext context)
- {
- EventSingle.Instance.Notify(EventDefine.ShowTips, "OnClickShopBtn");
- }
- private void OnClickSCBtn(EventContext context)
- {
- EventSingle.Instance.Notify(EventDefine.ShowTips, "OnClickSCBtn");
- }
- private void OnClickHDBtn(EventContext context)
- {
- EventSingle.Instance.Notify(EventDefine.ShowTips, "OnClickHDBtn");
- }
- private void OnClickXSLBtn(EventContext context)
- {
- EventSingle.Instance.Notify(EventDefine.ShowTips, "OnClickXSLBtn");
- }
- private void OnClickGoldBox(EventContext context)
- {
- EventSingle.Instance.Notify(EventDefine.ShowTips, "OnClickGoldBox");
- }
- private void OnClickTaskBtn(EventContext context)
- {
- EventSingle.Instance.Notify(EventDefine.ShowTips, "OnClickTaskBtn");
- }
- private void OnClickXinXiBtn(EventContext context)
- {
- EventSingle.Instance.Notify(EventDefine.ShowTips, "OnClickXinXiBtn");
- }
- private void OnClickSheZhiBtn(EventContext context)
- {
- EventSingle.Instance.Notify(EventDefine.ShowTips, "OnClickSheZhiBtn");
- }
- #endregion
- }
- }
|