|
@@ -0,0 +1,100 @@
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using ET;
|
|
|
+using FairyGUI;
|
|
|
+using UI.MiniGame;
|
|
|
+using UnityEngine;
|
|
|
+using System.Text.RegularExpressions;
|
|
|
+
|
|
|
+namespace GFGGame
|
|
|
+{
|
|
|
+ public class TZFEGameCheckView : BaseWindow
|
|
|
+ {
|
|
|
+ private UI_TZFEGameCheckUI _ui;
|
|
|
+ //后续这里改成读表内容,1:CardGame,2:Merge2048Game,3:HuarongRoadGame
|
|
|
+ private List<string> viewJumpName = new List<string>() {"","FlipGameView", "TZFEGameView" };
|
|
|
+ private List<ActivityOpenCfg> activityGameDate;
|
|
|
+ private List<Merge2048Game> gameDate;
|
|
|
+ private int type;
|
|
|
+ private int subType;
|
|
|
+
|
|
|
+ public override void Dispose()
|
|
|
+ {
|
|
|
+ if (_ui != null)
|
|
|
+ {
|
|
|
+ _ui.Dispose();
|
|
|
+ _ui = null;
|
|
|
+ }
|
|
|
+ base.Dispose();
|
|
|
+ }
|
|
|
+
|
|
|
+ protected override void OnInit()
|
|
|
+ {
|
|
|
+ base.OnInit();
|
|
|
+ packageName = UI_TZFEGameCheckUI.PACKAGE_NAME;
|
|
|
+ _ui = UI_TZFEGameCheckUI.Create();
|
|
|
+ this.viewCom = _ui.target;
|
|
|
+ isfullScreen = true;
|
|
|
+
|
|
|
+ _ui.m_game1.onClick.Add(OnClickBtnGameOne);
|
|
|
+ _ui.m_game2.onClick.Add(OnClickBtnGameTwo);
|
|
|
+ _ui.m_game3.onClick.Add(OnClickBtnGameThree);
|
|
|
+ _ui.m_backBtn.onClick.Add(OnClickBtnBack);
|
|
|
+ _ui.m_tipsOne.onClick.Add(RuleController.ShowRuleView);
|
|
|
+ }
|
|
|
+
|
|
|
+ protected override void OnShown()
|
|
|
+ {
|
|
|
+ base.OnShown();
|
|
|
+ type = (int)(this.viewData as object[])[0];
|
|
|
+ subType = (int)(this.viewData as object[])[1];
|
|
|
+ activityGameDate = ActivityOpenCfgArray.Instance.GetCfgsBytype(ConstLimitTimeActivityType.ActLimitStlyc);
|
|
|
+ gameDate = Merge2048GameArray.Instance.GetCfgsBytypeAndsubType(type, subType);
|
|
|
+ UpdateView();
|
|
|
+ }
|
|
|
+ protected override void OnHide()
|
|
|
+ {
|
|
|
+ base.OnHide();
|
|
|
+ }
|
|
|
+ private void UpdateView()
|
|
|
+ {
|
|
|
+ _ui.m_needNum1.text = gameDate[0].comsumeStartArr[0][1].ToString();
|
|
|
+ _ui.m_needNum2.text = gameDate[1].comsumeStartArr[0][1].ToString();
|
|
|
+ _ui.m_needNum3.text = gameDate[2].comsumeStartArr[0][1].ToString();
|
|
|
+ _ui.m_needIcon1.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(3000017).res);
|
|
|
+ _ui.m_needIcon2.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(3000017).res);
|
|
|
+ _ui.m_needIcon3.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(3000017).res);
|
|
|
+ _ui.m_gameLock2.visible = false;
|
|
|
+ _ui.m_gameLock3.visible = false;
|
|
|
+ _ui.m_tipsOne.data = 300027;
|
|
|
+ }
|
|
|
+ private void OnClickBtnBack()
|
|
|
+ {
|
|
|
+ this.Hide();
|
|
|
+ }
|
|
|
+
|
|
|
+ private async void OnClickBtnGameOne()
|
|
|
+ {
|
|
|
+ var result = await MiniGameProxy.ReqMiniGameStart(Merge2048GameArray.Instance.GetCfgsBytypeAndsubType(type, subType)[0].id, type, activityGameDate[0].id);
|
|
|
+ if (!result) return;
|
|
|
+ //当存在关卡时需要获取后台数据,哪一关了,这个可以在关卡界面写
|
|
|
+ ViewManager.Show($"GFGGame.{viewJumpName[type]}", new object[] { Merge2048GameArray.Instance.GetCfgsBytypeAndsubType(type, subType)[0].id });
|
|
|
+ }
|
|
|
+ private async void OnClickBtnGameTwo()
|
|
|
+ {
|
|
|
+ var result = await MiniGameProxy.ReqMiniGameStart(Merge2048GameArray.Instance.GetCfgsBytypeAndsubType(type, subType)[1].id, type, activityGameDate[0].id);
|
|
|
+ if (!result) return;
|
|
|
+ //当存在关卡时需要获取后台数据,哪一关了,这个可以在关卡界面写
|
|
|
+ ViewManager.Show($"GFGGame.{viewJumpName[type]}", new object[] { Merge2048GameArray.Instance.GetCfgsBytypeAndsubType(type, subType)[1].id });
|
|
|
+ }
|
|
|
+
|
|
|
+ private async void OnClickBtnGameThree()
|
|
|
+ {
|
|
|
+ var result = await MiniGameProxy.ReqMiniGameStart(Merge2048GameArray.Instance.GetCfgsBytypeAndsubType(type, subType)[2].id, type, activityGameDate[0].id);
|
|
|
+ if (!result) return;
|
|
|
+ //当存在关卡时需要获取后台数据,哪一关了,这个可以在关卡界面写
|
|
|
+ ViewManager.Show($"GFGGame.{viewJumpName[type]}", new object[] { Merge2048GameArray.Instance.GetCfgsBytypeAndsubType(type, subType)[2].id });
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|