浏览代码

小游戏修改提交

zhangyuqian 1 年之前
父节点
当前提交
5e07b8c2a2

+ 7 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/MiniGameProxy.cs

@@ -44,5 +44,12 @@ namespace GFGGame
             BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.BonusList));
             return true;
         }
+
+        public static async ETTask<bool> ReqGetGameUnlock(int id,int type,int activityId)
+        {
+            var response = (S2C_MiniGameUnlock)await MessageHelper.SendToServer(new C2S_MiniGameUnlock {GameId = id,GameType = type, ActivityId = activityId });
+            if (!(response is { Error: ErrorCode.ERR_Success })) return false;
+            return true;
+        }
     }
 }

+ 9 - 9
GameClient/Assets/Game/HotUpdate/Views/MiniGame/ChallengeRewardView.cs

@@ -110,7 +110,7 @@ namespace GFGGame
         {
             UI_ChallengeRewardItemUI item = UI_ChallengeRewardItemUI.Proxy(obj);
             int starNum = 3 - index;
-            item.m_rewardDesc.text = string.Format("{0}游戏首次{1}星通关", MiniGameArray.Instance.GetCfg(gameList[2]).typeName, starNum);
+            item.m_rewardDesc.text = string.Format("{0}游戏关卡{1}首次通关", MiniGameArray.Instance.GetCfg(gameList[2]).typeName,index);
             item.m_rewardList.itemRenderer = RenditemReward;
             //读表
             //var reward;
@@ -124,8 +124,8 @@ namespace GFGGame
             }
             List<int> rewardList = new List<int>();
             List<int> starList = new List<int>() { Merge2048GameDate[0].timeStar3, Merge2048GameDate[0].timeStar2, Merge2048GameDate[0].timeStar1 };
-            rewardList.Add(CardGameDate[0].id);
-            rewardList.Add(CardGameDate[0].type);
+            rewardList.Add(Merge2048GameDate[0].id);
+            rewardList.Add(Merge2048GameDate[0].type);
             rewardList.Add(1);
             rewardList.Add(3 - index);
             rewardList.Add(MiniGameDateManager.Instance.gameinfoList[1].StarRewardStatus[2 - index]);
@@ -161,16 +161,16 @@ namespace GFGGame
                 switch (num)
                 {
                     case 1:
-                        item.m_icon.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(Merge2048GameDate[0].bonusStar1Arr[0][0]).res);
-                        item.m_Num.text = Merge2048GameDate[0].bonusStar1Arr[0][1].ToString();
+                        item.m_icon.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(Merge2048GameDate[0].bonusWinFirstArr[0][0]).res);
+                        item.m_Num.text = Merge2048GameDate[0].bonusWinFirstArr[0][1].ToString();
                         break;
                     case 2:
-                        item.m_icon.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(Merge2048GameDate[0].bonusStar3Arr[0][0]).res);
-                        item.m_Num.text = Merge2048GameDate[0].bonusStar2Arr[0][1].ToString();
+                        item.m_icon.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(Merge2048GameDate[1].bonusWinFirstArr[0][0]).res);
+                        item.m_Num.text = Merge2048GameDate[1].bonusWinFirstArr[0][1].ToString();
                         break;
                     case 3:
-                        item.m_icon.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(Merge2048GameDate[0].bonusStar3Arr[0][0]).res);
-                        item.m_Num.text = Merge2048GameDate[0].bonusStar3Arr[0][1].ToString();
+                        item.m_icon.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(Merge2048GameDate[2].bonusWinFirstArr[0][0]).res);
+                        item.m_Num.text = Merge2048GameDate[2].bonusWinFirstArr[0][1].ToString();
                         break;
                     default:
                         break;

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/MiniGame/FlipGameView.cs

@@ -349,7 +349,7 @@ namespace GFGGame
             List<int> tArray = new List<int>();
             for(int i=0;i<numCount;i++)
             {
-                tArray.Add(i + 1);
+                tArray.Add(i);
             }
             RandomCardList(tArray, numCount);
             for(int i = 0;i <cardNum;i+=2)

+ 4 - 7
GameClient/Assets/Game/HotUpdate/Views/MiniGame/GameStartView.cs

@@ -12,7 +12,7 @@ namespace GFGGame
     {
         private UI_GameStartUI _ui;
         //后续这里改成读表内容,1:CardGame,2:Merge2048Game,3:HuarongRoadGame
-        private List<string> viewJumpName = new List<string>() {"","FlipGameView", "TZFEGameView" ,"ActivityHuaRongDaoView"};
+        private List<string> viewJumpName = new List<string>() {"","FlipGameView", "TZFEGameCheckView" ,"ActivityHuaRongDaoView"};
         private List<ActivityOpenCfg> activityGameDate;
         private List<int> GameType = new List<int>();
         private List<int> ChallengeList = new List<int>();
@@ -132,12 +132,9 @@ namespace GFGGame
             if (!result) return;
             ViewManager.Show($"GFGGame.{viewJumpName[GameType[0]]}", new object[] { CardGameArray.Instance.GetCfgsBytypeAndsubType(GameType[0], GameType[1])[0].id });
         }
-        private async void OnClickBtnGameTwo()
+        private void OnClickBtnGameTwo()
         {
-            var result = await MiniGameProxy.ReqMiniGameStart(Merge2048GameArray.Instance.GetCfgsBytypeAndsubType(GameType[2], GameType[3])[0].id, GameType[2], activityGameDate[0].id);
-            if (!result) return;
-            //当存在关卡时需要获取后台数据,哪一关了,这个可以在关卡界面写
-            ViewManager.Show($"GFGGame.{viewJumpName[GameType[2]]}",new object[] { Merge2048GameArray.Instance.GetCfgsBytypeAndsubType(GameType[2],GameType[3])[0].id });
+            ViewManager.Show($"GFGGame.{viewJumpName[GameType[2]]}",new object[] { GameType[2],GameType[3]});
         }
 
         private void GetGameIdByActivityDate()
@@ -194,7 +191,7 @@ namespace GFGGame
                         break;
                     case 2:
                        List<Merge2048Game> Merge2048GameDate = Merge2048GameArray.Instance.GetCfgsBytypeAndsubType(GameType[i], GameType[i + 1]);
-                        if (Merge2048GameDate.Count <= 1)
+                        if (Merge2048GameDate.Count <= 1 || Merge2048GameDate[0].bonusWinFirstArr.Length > 0)
                         {
                             ChallengeList.Add(GameType[i]);
                             ChallengeList.Add(GameType[i + 1]);

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Views/MiniGame/ResultTipsView.cs

@@ -135,9 +135,9 @@ namespace GFGGame
                     _ui.m_star3.url = "ui://MiniGame/tb_zx_pt_star";
                     break;
                 default:
-                    _ui.m_star1.url = "ui://MiniGame/tb_zx_pt_star_grey";
-                    _ui.m_star2.url = "ui://MiniGame/tb_zx_pt_star_grey";
-                    _ui.m_star3.url = "ui://MiniGame/tb_zx_pt_star_grey";
+                    _ui.m_star1.visible = false;
+                    _ui.m_star2.visible = false;
+                    _ui.m_star3.visible = false;
                     break;
             }
         }

+ 18 - 15
GameClient/Assets/Game/HotUpdate/Views/MiniGame/TZFEGameVIew.cs

@@ -32,9 +32,9 @@ namespace GFGGame
         //评价
         private List<int> CustemsNum = new List<int>()
         {
-            240,
-            180,
-            120,
+            0,
+            0,
+            0,
         };
         private bool isMove;
         private bool isMerge;
@@ -66,8 +66,8 @@ namespace GFGGame
             this.viewCom = _ui.target;
             isfullScreen = true;
             _ui.m_numList.itemRenderer = ListNumItem;
-            _ui.target.onTouchBegin.Add(OnClickBegin);
-            _ui.target.onTouchEnd.Add(OnClickEnd);
+            _ui.m_numList.onTouchBegin.Add(OnClickBegin);
+            _ui.m_numList.onTouchEnd.Add(OnClickEnd);
             _ui.m_backBtn.onClick.Add(OnClickBtnBack);
             _ui.m_mergeBtn.onClick.Add(OnClickMergeTips);
             Map = new int[rows, columns];
@@ -129,17 +129,20 @@ namespace GFGGame
         }
         private void UpdateView()
         {
-            time = 0;
+            time = 1;
             score = 0;
             targetNum = Merge2048GameArray.Instance.GetCfg(gameID).targetNum;
             CustemsNum[0] = Merge2048GameArray.Instance.GetCfg(gameID).timeStar3;
             CustemsNum[1] = Merge2048GameArray.Instance.GetCfg(gameID).timeStar2;
             CustemsNum[2] = Merge2048GameArray.Instance.GetCfg(gameID).timeStar1;
             _ui.m_star3.url = "ui://MiniGame/tb_zx_pt_star";
-            _ui.m_target.url = string.Format("ui://MiniGame/sgll2_{0}", targetNum);
+            _ui.m_target.url = ResPathUtil.GetMiniGamePicPath(Merge2048CfgArray.Instance.GetCfgsByidAndnum(gameDate.subType, targetNum)[0].resName);
             _ui.m_score.text = string.Format("分数:{0}", score.ToString());
             _ui.m_score.visible = false;
+            _ui.m_time.visible = false;
+            _ui.m_timeNum.visible = false;
             rand = new System.Random();
+            UpdateStar();
             Timers.inst.Add(1.0f, 0, UpdateTime);
         }
         private void UpdateScore()
@@ -481,22 +484,22 @@ namespace GFGGame
         private void OnClickEnd()
         {
                 touchSecond = Input.mousePosition;//记录拖动的位置
-                if (touchSecond.x < touchFirst.x && Math.Abs(touchSecond.x - touchFirst.x) > Math.Abs(touchSecond.y - touchFirst.y))
+                if ((touchSecond.x - touchFirst.x) < -80 && Math.Abs(touchSecond.x - touchFirst.x) > Math.Abs(touchSecond.y - touchFirst.y))
                 {
                     //向左滑动
                     Move(Map, Direction.left);
                 }
-                if (touchSecond.x > touchFirst.x && Math.Abs(touchSecond.x - touchFirst.x) > Math.Abs(touchSecond.y - touchFirst.y))
+                if ( (touchSecond.x - touchFirst.x) > 80 && Math.Abs(touchSecond.x - touchFirst.x) > Math.Abs(touchSecond.y - touchFirst.y))
                 {
                     //向右滑动
                     Move(Map, Direction.right);
                 }
-                if (touchSecond.y < touchFirst.y && Math.Abs(touchSecond.y - touchFirst.y) > Math.Abs(touchSecond.x - touchFirst.x))
+                if ((touchSecond.y - touchFirst.y) < -80 && Math.Abs(touchSecond.y - touchFirst.y) > Math.Abs(touchSecond.x - touchFirst.x))
                 {
                     //向下滑动
                     Move(Map, Direction.down);
                 }
-                if (touchSecond.y > touchFirst.y && Math.Abs(touchSecond.y - touchFirst.y) > Math.Abs(touchSecond.x - touchFirst.x))
+                if ((touchSecond.y - touchFirst.y) > 80 && Math.Abs(touchSecond.y - touchFirst.y) > Math.Abs(touchSecond.x - touchFirst.x))
                 {
                     //向上滑动
                     Move(Map, Direction.up);
@@ -512,7 +515,7 @@ namespace GFGGame
         {
             _ui.m_timeNum.text = sec_to_hms(time);
             time++;
-            UpdateStar();
+            //UpdateStar();
         }
 
         private void UpdateStar()
@@ -543,9 +546,9 @@ namespace GFGGame
                     _ui.m_star3.url = "ui://MiniGame/tb_zx_pt_star";
                     break;
                 default:
-                    _ui.m_star1.url = "ui://MiniGame/tb_zx_pt_star_grey";
-                    _ui.m_star2.url = "ui://MiniGame/tb_zx_pt_star_grey";
-                    _ui.m_star3.url = "ui://MiniGame/tb_zx_pt_star_grey";
+                    _ui.m_star1.visible = false;
+                    _ui.m_star2.visible = false;
+                    _ui.m_star3.visible = false;
                     break;
             }
         }

二进制
GameClient/Assets/ResIn/UI/MiniGame/MiniGame_atlas0.png


+ 1 - 1
GameClient/Assets/ResIn/UI/MiniGame/MiniGame_atlas0.png.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 152ea7696f47eb9429d55d0d80c058aa
+guid: fa2a3c0c31a363a4fb4237b7c97dc34e
 TextureImporter:
   internalIDToNameTable: []
   externalObjects: {}

二进制
GameClient/Assets/ResIn/UI/MiniGame/MiniGame_atlas0_1.png


+ 1 - 1
GameClient/Assets/ResIn/UI/MiniGame/MiniGame_atlas0_1.png.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: ed0ac63148b64a84597db5c722546182
+guid: 023ab59054f19c547877c830b3460dc9
 TextureImporter:
   internalIDToNameTable: []
   externalObjects: {}

+ 1 - 1
GameClient/Assets/ResIn/UI/MiniGame/MiniGame_atlas0_2.png.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: e586b5b1b3e962b4a8223139d98a6686
+guid: 954f701dda00a7e4ba94a7b5e5da951d
 TextureImporter:
   internalIDToNameTable: []
   externalObjects: {}

+ 1 - 1
GameClient/Assets/ResIn/UI/MiniGame/MiniGame_atlas0_3.png.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 5f9143c11f4c8d64a82ac0c8c40d1378
+guid: 96d0b2af4d098fc41a3c7ec5de901ebd
 TextureImporter:
   internalIDToNameTable: []
   externalObjects: {}

+ 1 - 1
GameClient/Assets/ResIn/UI/MiniGame/MiniGame_atlas0_4.png.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 225607aabd8697b49a16ef2c8fc1d3c8
+guid: f4233f01723bfaf4b8d4eab8396b04b9
 TextureImporter:
   internalIDToNameTable: []
   externalObjects: {}

二进制
GameClient/Assets/ResIn/UI/MiniGame/MiniGame_fui.bytes


+ 1 - 1
GameClient/Assets/ResIn/UI/MiniGame/MiniGame_fui.bytes.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 4f5a6dd9a6bb7ae44befd5fb1fdbf776
+guid: 44c9ff70c2f5e7a419e6369c859c7776
 TextScriptImporter:
   externalObjects: {}
   userData: