Переглянути джерело

Merge branch 'master' of http://10.108.64.190:3000/gfg/client

guodong 1 рік тому
батько
коміт
755721f841
28 змінених файлів з 270 додано та 123 видалено
  1. 1 0
      GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs
  2. 2 2
      GameClient/Assets/Game/HotUpdate/Data/RedDotDataManager.cs
  3. 1 1
      GameClient/Assets/Game/HotUpdate/Data/ShopDataManager.cs
  4. 3 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ActivityGetYuanXiao/UI_ActivityGetYuanXiaoEntryUI.cs
  5. 6 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ClothingDecompose/UI_ClothingDecomposeUI.cs
  6. 6 3
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/MiniGame/UI_GameStartUI.cs
  7. 1 0
      GameClient/Assets/Game/HotUpdate/ServerProxy/CommonSProxy.cs
  8. 1 1
      GameClient/Assets/Game/HotUpdate/ServerProxy/LeagueSproxy.cs
  9. 41 6
      GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoDataManager.cs
  10. 83 66
      GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoEntryView.cs
  11. 1 0
      GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoFailView.cs
  12. 21 0
      GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoProxy.cs
  13. 11 0
      GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoProxy.cs.meta
  14. 1 0
      GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoSuccessView.cs
  15. 1 2
      GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoTaskView.cs
  16. 68 34
      GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoView.cs
  17. 1 0
      GameClient/Assets/Game/HotUpdate/Views/ClothingDecompose/ClothingDecomposeView.cs
  18. 1 1
      GameClient/Assets/Game/HotUpdate/Views/Common/Controller/ValueBarController.cs
  19. 2 0
      GameClient/Assets/Game/HotUpdate/Views/League/LeagueCreatView.cs
  20. 1 1
      GameClient/Assets/Game/HotUpdate/Views/League/LeagueJoinView.cs
  21. 9 1
      GameClient/Assets/Game/HotUpdate/Views/League/LeagueView.cs
  22. 8 5
      GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs
  23. BIN
      GameClient/Assets/ResIn/UI/ActivityGetYuanXiao/ActivityGetYuanXiao_atlas0!a.png
  24. BIN
      GameClient/Assets/ResIn/UI/ActivityGetYuanXiao/ActivityGetYuanXiao_atlas0.png
  25. BIN
      GameClient/Assets/ResIn/UI/ActivityGetYuanXiao/ActivityGetYuanXiao_fui.bytes
  26. BIN
      GameClient/Assets/ResIn/UI/ClothingDecompose/ClothingDecompose_fui.bytes
  27. BIN
      GameClient/Assets/ResIn/UI/MiniGame/MiniGame_fui.bytes
  28. BIN
      GameClient/Assets/ResIn/UI/Store/Store_fui.bytes

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs

@@ -123,6 +123,7 @@ namespace GFGGame
         public const string NOTICE_CHAT_MESSAGE = "NOTICE_CHAT_MESSAGE"; //通知聊天信息
         public const string OPEN_CHAT_MESSAGE = "OPEN_CHAT_MESSAGE"; //打开查看聊天信息
         public const string ACTIVE_SKILL = "ACTIVE_SKILL";//技能激活
+        public const string GET_LEAGUE_INFO = "GET_LEAGUE_INFO";//获得联盟信息
 
         public const string CONTINUOUS_REBATE_GIFT = "CONTINUOUS_REBATE_GIFT"; //领取连续返利礼包
         public const string CONTINUOUS_REBATE_GIFT_SHOP_BUY = "CONTINUOUS_REBATE_GIFT_SHOP_BUY";

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Data/RedDotDataManager.cs

@@ -1070,8 +1070,8 @@ namespace GFGGame
 
         public bool GetActivityYuanXiaoRed()
         {
-            return false;
-            //return TaskDataManager.Instance.CheckTaskRewardCanGet(TaskFuncType.YuanXiaoActivity);
+            return ActivityGetYuanXiaoDataManager.Instance.HaveNewLevelCanPlay()
+            || TaskDataManager.Instance.CheckTaskRewardCanGet(TaskFuncType.YuanXiaoActivity);
         }
 
         /// <summary>

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/ShopDataManager.cs

@@ -185,7 +185,7 @@ namespace GFGGame
                     bool isDown = ArenaDataManager.Instance.SeasonId - GlobalCfgArray.globalCfg.seasonReduce > 0;
                     lockValue = isDown ? Math.Max(1, shopCfg.lockValue - GlobalCfgArray.globalCfg.rankReduce) : shopCfg.lockValue;
                 }
-                return ArenaDataManager.Instance.Grade >= lockValue;
+                return ArenaDataManager.Instance.HighestGrade >= lockValue;
             }
             return true;
         }

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ActivityGetYuanXiao/UI_ActivityGetYuanXiaoEntryUI.cs

@@ -22,6 +22,7 @@ namespace UI.ActivityGetYuanXiao
         public GButton m_btnBack;
         public GGraph m_btnStart;
         public Transition m_t0;
+        public Transition m_listShow;
         public const string URL = "ui://tguohf7uqkvg4";
         public const string PACKAGE_NAME = "ActivityGetYuanXiao";
         public const string RES_NAME = "ActivityGetYuanXiaoEntryUI";
@@ -84,6 +85,7 @@ namespace UI.ActivityGetYuanXiao
             m_btnBack = (GButton)comp.GetChild("btnBack");
             m_btnStart = (GGraph)comp.GetChild("btnStart");
             m_t0 = comp.GetTransition("t0");
+            m_listShow = comp.GetTransition("listShow");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -102,6 +104,7 @@ namespace UI.ActivityGetYuanXiao
             m_btnBack = null;
             m_btnStart = null;
             m_t0 = null;
+            m_listShow = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 6 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ClothingDecompose/UI_ClothingDecomposeUI.cs

@@ -9,6 +9,7 @@ namespace UI.ClothingDecompose
         public GComponent target;
         public Controller m_c1;
         public Controller m_TouchSelect;
+        public Controller m_clothesType;
         public GLoader m_bg;
         public UI_Button6 m_btnClothing;
         public UI_Button6 m_btnSkillBook;
@@ -24,6 +25,7 @@ namespace UI.ClothingDecompose
         public GTextField m_txtConsume;
         public GTextField m_txtTips;
         public GButton m_btnSelect;
+        public GTextField m_txtGetRewardTips;
         public const string URL = "ui://h9mv1l71wlc20";
         public const string PACKAGE_NAME = "ClothingDecompose";
         public const string RES_NAME = "ClothingDecomposeUI";
@@ -73,6 +75,7 @@ namespace UI.ClothingDecompose
         {
             m_c1 = comp.GetController("c1");
             m_TouchSelect = comp.GetController("TouchSelect");
+            m_clothesType = comp.GetController("clothesType");
             m_bg = (GLoader)comp.GetChild("bg");
             m_btnClothing = (UI_Button6)UI_Button6.Create(comp.GetChild("btnClothing"));
             m_btnSkillBook = (UI_Button6)UI_Button6.Create(comp.GetChild("btnSkillBook"));
@@ -88,11 +91,13 @@ namespace UI.ClothingDecompose
             m_txtConsume = (GTextField)comp.GetChild("txtConsume");
             m_txtTips = (GTextField)comp.GetChild("txtTips");
             m_btnSelect = (GButton)comp.GetChild("btnSelect");
+            m_txtGetRewardTips = (GTextField)comp.GetChild("txtGetRewardTips");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_c1 = null;
             m_TouchSelect = null;
+            m_clothesType = null;
             m_bg = null;
             m_btnClothing.Dispose();
             m_btnClothing = null;
@@ -110,6 +115,7 @@ namespace UI.ClothingDecompose
             m_txtConsume = null;
             m_txtTips = null;
             m_btnSelect = null;
+            m_txtGetRewardTips = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 6 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/MiniGame/UI_GameStartUI.cs

@@ -12,8 +12,9 @@ namespace UI.MiniGame
         public UI_Component2 m_rewardBtn;
         public GLoader m_shopBtn;
         public GLoader m_ticket;
-        public GLoader m_addIcon;
+        public GLoader m_addIconImg;
         public GTextField m_ticketNum;
+        public GLoader m_addIcon;
         public GLoader m_game1;
         public GGraph m_effectIcon1;
         public GGraph m_effectText1;
@@ -78,8 +79,9 @@ namespace UI.MiniGame
             m_rewardBtn = (UI_Component2)UI_Component2.Create(comp.GetChild("rewardBtn"));
             m_shopBtn = (GLoader)comp.GetChild("shopBtn");
             m_ticket = (GLoader)comp.GetChild("ticket");
-            m_addIcon = (GLoader)comp.GetChild("addIcon");
+            m_addIconImg = (GLoader)comp.GetChild("addIconImg");
             m_ticketNum = (GTextField)comp.GetChild("ticketNum");
+            m_addIcon = (GLoader)comp.GetChild("addIcon");
             m_game1 = (GLoader)comp.GetChild("game1");
             m_effectIcon1 = (GGraph)comp.GetChild("effectIcon1");
             m_effectText1 = (GGraph)comp.GetChild("effectText1");
@@ -101,8 +103,9 @@ namespace UI.MiniGame
             m_rewardBtn = null;
             m_shopBtn = null;
             m_ticket = null;
-            m_addIcon = null;
+            m_addIconImg = null;
             m_ticketNum = null;
+            m_addIcon = null;
             m_game1 = null;
             m_effectIcon1 = null;
             m_effectText1 = null;

+ 1 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/CommonSProxy.cs

@@ -66,6 +66,7 @@ namespace GFGGame
                     await MiniGameProxy.ReqGetChallengeReward();
                     ActivitySProxy.ReqGetActivitySignInfos().Coroutine();
                     NewYearRedEnvelopeSProxy.ReqGetRedPacketInfo().Coroutine();
+                    ActivityGetYuanXiaoProxy.ReqGetActivityGameInfos().Coroutine();
                     ActivityDataManager.Instance.todayActivityTips = GameGlobal.myNumericComponent.GetAsInt(NumericType.IsPropYchmActivity);
                     ActivityDataManager.Instance.todayMonthlyCardTips = GameGlobal.myNumericComponent.GetAsInt(NumericType.IsPropCzykActivity);
                     EventAgent.DispatchEvent(ConstMessage.RESET_DAILY_DATA);

+ 1 - 1
GameClient/Assets/Game/HotUpdate/ServerProxy/LeagueSproxy.cs

@@ -374,7 +374,7 @@ namespace GFGGame
                         }
                     }
 
-
+                    EventAgent.DispatchEvent(ConstMessage.GET_LEAGUE_INFO);
                     return true;
                 }
             }

+ 41 - 6
GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoDataManager.cs

@@ -1,16 +1,51 @@
 using ET;
 using System.Collections;
+using System.Collections.Generic;
+using System.Threading.Tasks;
 using UnityEngine;
 
 namespace GFGGame
 {
     public class ActivityGetYuanXiaoDataManager : SingletonBase<ActivityGetYuanXiaoDataManager>
     {
-        //public bool CheckOpen()
-        //{
-        //    var activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfoOneByType(ActivityType.YuanXiao);
-        //    return activityInfo != null && activityInfo.StartTime <= TimeHelper.ServerNow() &&
-        //           activityInfo.EndTime > TimeHelper.ServerNow();
-        //}
+        public bool CheckOpen()
+        {
+            var activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfoOneByType(ActivityType.YuanXiao);
+            return activityInfo != null && activityInfo.StartTime <= TimeHelper.ServerNow() &&
+                   activityInfo.EndTime > TimeHelper.ServerNow();
+        }
+
+        public bool HaveNewLevelCanPlay()
+        {
+            int curLevel = GetCurLevel();
+            if(curLevel == gameinfoList.Count)
+            {
+                return false;
+            }
+
+            long haveNum = ItemDataManager.GetItemNum(PickUpGameArray.Instance.dataArray[curLevel].comsumePassArr[0][0]);
+            bool canPlay = (haveNum >= PickUpGameArray.Instance.dataArray[curLevel].comsumePassArr[0][1]);
+
+            return canPlay;
+        }
+
+        public int GetCurLevel()
+        {
+            //return gameinfoList.Count;
+
+            int i;
+            for (i = 0; i < gameinfoList.Count; i++)
+            {
+                if (!gameinfoList[i].IsCleared)
+                {
+                    return i;
+                }
+            }
+
+            return i;
+        }
+
+
+        public List<GameInfoProto> gameinfoList = new List<GameInfoProto>();
     }
 }

+ 83 - 66
GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoEntryView.cs

@@ -12,7 +12,7 @@ namespace GFGGame
         private UI_ActivityGetYuanXiaoEntryUI _ui;
         private ValueBarController _valueBarController;
         private Dictionary<string, EffectUI> _effectUIDic = new Dictionary<string, EffectUI>();
-
+        private int _curLevel;
 
         public override void Dispose()
         {
@@ -21,6 +21,7 @@ namespace GFGGame
             {
                 EffectUIPool.Recycle(v.Value);
             }
+            _effectUIDic.Clear();
 
             if (_valueBarController != null)
             {
@@ -48,21 +49,12 @@ namespace GFGGame
 
             _valueBarController = new ValueBarController(_ui.m_valueBar);
             _ui.m_list.itemRenderer = ListRenderer;
-            _ui.m_list.onClickItem.Add(OnListItemClick);
             _ui.m_btnStart.onClick.Add(OnBtnStartClick);
             _ui.m_btnTask.onClick.Add(OnBtnTaskClick);
             _ui.m_btnShop.onClick.Add(OnBtnShopClick);
             _ui.m_btnBack.onClick.Add(Hide);
 
-            _effectUIDic.Add("YXJ_bg_tx", EffectUIPool.CreateEffectUI(_ui.m_bgEffect, "ui_Activity", "YXJ_bg_tx"));
-            _effectUIDic.Add("YXJ_Button", EffectUIPool.CreateEffectUI(_ui.m_startBtnEffect, "ui_Activity", "YXJ_Button"));
-            _effectUIDic.Add("YXJ_Middle", EffectUIPool.CreateEffectUI(_ui.m_yuanXiaoEffect, "ui_Activity", "YXJ_Middle"));
-            _effectUIDic.Add("YXJ_Text", EffectUIPool.CreateEffectUI(_ui.m_titleTextEffect, "ui_Activity", "YXJ_Text"));
-            _effectUIDic.Add("YXJ_Open_Down", EffectUIPool.CreateEffectUI(_ui.m_cloudEffect, "ui_Activity", "YXJ_Open_Down"));
-            _effectUIDic.Add("YXJ_Open_Up", EffectUIPool.CreateEffectUI(_ui.m_leafEffect, "ui_Activity", "YXJ_Open_Up"));
-            _effectUIDic.Add("RedPack_doubao_Loop_R", EffectUIPool.CreateEffectUI(_ui.m_doubaoEffect, "ui_Activity", "RedPack_doubao_Loop_R"));
-
-
+            AddEffect();
         }
 
         protected async override void OnShown()
@@ -71,32 +63,40 @@ namespace GFGGame
             _valueBarController.OnShown();
             _valueBarController.UpdateList(new List<int>() { PickUpGameArray.Instance.dataArray[0].comsumePassArr[0][0] });
 
-            //var result = await MiniGameProxy.ReqGetActivityGameInfos(5004);
-            //if (!isShowing || !result)
-            //{
-            //    return;
-            //}
+            _ui.m_list.visible = false;
+            var result = await ActivityGetYuanXiaoProxy.ReqGetActivityGameInfos();
+            if (!isShowing || !result)
+            {
+                return;
+            }
 
-            _ui.m_list.numItems = PickUpGameArray.Instance.dataArray.Length;
-            _ui.m_list.selectedIndex = GetCurLevel();
-            _ui.m_list.ScrollToView(_ui.m_list.selectedIndex);
+            _ui.m_list.visible = true;
+            _ui.m_listShow.Play();
+            _curLevel = ActivityGetYuanXiaoDataManager.Instance.GetCurLevel();
+            _ui.m_list.numItems = ActivityGetYuanXiaoDataManager.Instance.gameinfoList.Count;
+            _ui.m_list.selectedIndex = Mathf.Min(_curLevel, ActivityGetYuanXiaoDataManager.Instance.gameinfoList.Count - 1);
+            AutoLocationCurLevel();
+            UpdateRedDots();
         }
 
         protected override void OnHide()
         {
             base.OnHide();
+            _valueBarController.OnHide();
         }
 
         protected override void AddEventListener()
         {
             base.AddEventListener();
             EventAgent.AddEventListener(ConstMessage.ACTIVITY_GETYUANXIAO_START, StartGame);
+            EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDots);
         }
 
         protected override void RemoveEventListener()
         {
             base.RemoveEventListener();
             EventAgent.RemoveEventListener(ConstMessage.ACTIVITY_GETYUANXIAO_START, StartGame);
+            EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDots);
         }
 
         private void ListRenderer(int index, GObject item)
@@ -107,50 +107,33 @@ namespace GFGGame
             level.m_spendIcon.url = ResPathUtil.GetIconPath(ItemCfgArray.Instance.GetCfg(pickUpGame.comsumePassArr[0][0]).res, "png");
             level.m_iconLevel.url = string.Format("ui://ActivityGetYuanXiao/yx_xg_{0}", index % 4 + 1);
             level.m_num.text = pickUpGame.comsumePassArr[0][1].ToString();
-            level.m_c1.selectedIndex = 0;
-
-            //level.m_c1.selectedIndex = MiniGameDateManager.Instance.gameinfoList[index].IsUnlock ? 0 : 1;
-            UI_level.ProxyEnd();
-        }
-
-        private void OnListItemClick(EventContext eventContext)
-        {
-            //GObject gObject = (GObject)eventContext.sender;
-            //int index = (int)gObject.data;
-            //UI_level level = UI_level.Proxy(gObject);
-            
-            //UI_level.ProxyEnd();
-        }
 
-        // 获取当前达到的关卡
-        private int GetCurLevel()
-        {
-            return 0;
-
-            int i;
-            for (i = 0; i < MiniGameDateManager.Instance.gameinfoList.Count; i++)
+            int stateIndex = 0;
+            if (index > _curLevel)
             {
-                if (!MiniGameDateManager.Instance.gameinfoList[i].IsCleared)
-                {
-                    return i;
-                }
+                stateIndex = 1;
             }
+            else if(index < _curLevel)
+            {
+                stateIndex = 2;
+            }
+            level.m_c1.selectedIndex = stateIndex;
 
-            return i - 1;
+            UI_level.ProxyEnd();
         }
 
         private void OnBtnStartClick()
         {
-            //if (!MiniGameDateManager.Instance.gameinfoList[_ui.m_list.selectedIndex].IsUnlock)
-            //{
-            //    PromptController.Instance.ShowFloatTextPrompt("关卡未解锁");
-            //    return;
-            //}
-            //if (MiniGameDateManager.Instance.gameinfoList[_ui.m_list.selectedIndex].IsCleared)
-            //{
-            //    PromptController.Instance.ShowFloatTextPrompt("关卡已通过");
-            //    return;
-            //}
+            if (_ui.m_list.selectedIndex > _curLevel)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("关卡未解锁");
+                return;
+            }
+            if (_ui.m_list.selectedIndex < _curLevel)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("关卡已通过");
+                return;
+            }
 
             PickUpGame cfg = PickUpGameArray.Instance.dataArray[_ui.m_list.selectedIndex];
             ViewManager.Show<ActivityGetYuanXiaoTargetView>(cfg);
@@ -158,28 +141,27 @@ namespace GFGGame
 
         private async void StartGame()
         {
-            //int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(12);
-            //if(activityID == 0)
-            //{
-            //    return;
-            //}
+            int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
+            if (activityID == 0)
+            {
+                return;
+            }
 
             PickUpGame cfg = PickUpGameArray.Instance.dataArray[_ui.m_list.selectedIndex];
-            //var result = await MiniGameProxy.ReqMiniGameStart(cfg.id, cfg.type, activityID);
-            //if (!result || !isShowing) return;
+            var result = await MiniGameProxy.ReqMiniGameStart(cfg.id, cfg.type, activityID);
+            if (!result || !isShowing) return;
 
-            //ViewManager.Show<ActivityGetYuanXiaoView>(new object[] { cfg, activityID });
-            ViewManager.Show<ActivityGetYuanXiaoView>(new object[] { cfg, 0 });
+            ViewManager.Show<ActivityGetYuanXiaoView>(new object[] { cfg, activityID });
         }
 
         private void OnBtnShopClick()
         {
-            ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_GIFT_BAG, ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY });
+            ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_EXCHANGE, ConstStoreSubId.STORE_ACTIVITY_EXCHANGE });
         }
 
         private void OnBtnTaskClick()
         {
-            int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(12);
+            int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
             if (activityID == 0)
             {
                 return;
@@ -187,5 +169,40 @@ namespace GFGGame
             ViewManager.Show<ActivityGetYuanXiaoTaskView>(activityID);
         }
 
+        private void UpdateRedDots()
+        {
+            bool canPlay = ActivityGetYuanXiaoDataManager.Instance.HaveNewLevelCanPlay();
+
+            for (int i = 0; i < _ui.m_list.numChildren; i++)
+            {
+                if (i == _curLevel)
+                {
+                    RedDotController.Instance.SetComRedDot(_ui.m_list.GetChildAt(i).asCom, canPlay, "", -21, 29);
+                }
+                else
+                {
+                    RedDotController.Instance.SetComRedDot(_ui.m_list.GetChildAt(i).asCom, false);
+                }
+            }
+
+            RedDotController.Instance.SetComRedDot(_ui.m_btnTask, 
+                TaskDataManager.Instance.CheckTaskRewardCanGet(TaskFuncType.YuanXiaoActivity), "", -25, 20);
+        }
+
+        private void AddEffect()
+        {
+            _effectUIDic.Add("YXJ_bg_tx", EffectUIPool.CreateEffectUI(_ui.m_bgEffect, "ui_Activity", "YXJ_bg_tx"));
+            _effectUIDic.Add("YXJ_Button", EffectUIPool.CreateEffectUI(_ui.m_startBtnEffect, "ui_Activity", "YXJ_Button"));
+            _effectUIDic.Add("YXJ_Middle", EffectUIPool.CreateEffectUI(_ui.m_yuanXiaoEffect, "ui_Activity", "YXJ_Middle"));
+            _effectUIDic.Add("YXJ_Text", EffectUIPool.CreateEffectUI(_ui.m_titleTextEffect, "ui_Activity", "YXJ_Text"));
+            _effectUIDic.Add("YXJ_Open_Down", EffectUIPool.CreateEffectUI(_ui.m_cloudEffect, "ui_Activity", "YXJ_Open_Down"));
+            _effectUIDic.Add("YXJ_Open_Up", EffectUIPool.CreateEffectUI(_ui.m_leafEffect, "ui_Activity", "YXJ_Open_Up"));
+            _effectUIDic.Add("RedPack_doubao_Loop_R", EffectUIPool.CreateEffectUI(_ui.m_doubaoEffect, "ui_Activity", "RedPack_doubao_Loop_R"));
+        }
+
+        private void AutoLocationCurLevel()
+        {
+            _ui.m_list.ScrollToView(Mathf.Min(_curLevel, ActivityGetYuanXiaoDataManager.Instance.gameinfoList.Count - 1));
+        }
     }
 }

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoFailView.cs

@@ -17,6 +17,7 @@ namespace GFGGame
             {
                 EffectUIPool.Recycle(v.Value);
             }
+            _effectUIDic.Clear();
 
             if (_ui != null)
             {

+ 21 - 0
GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoProxy.cs

@@ -0,0 +1,21 @@
+using ET;
+using System.Collections;
+using UnityEngine;
+
+namespace GFGGame
+{
+    public class ActivityGetYuanXiaoProxy
+    {
+        public static async ETTask<bool> ReqGetActivityGameInfos()
+        {
+            int activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
+            if (activityId <= 0)
+                return false;
+
+            var response = (S2C_GetActivityGameInfos)await MessageHelper.SendToServer(new C2S_GetActivityGameInfos { ActivityId = activityId });
+            if (!(response is { Error: ErrorCode.ERR_Success })) return false;
+            ActivityGetYuanXiaoDataManager.Instance.gameinfoList = response.GameInfoList;
+            return true;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoProxy.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ca355cb42084c0c48a44b010e3abed04
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoSuccessView.cs

@@ -39,6 +39,7 @@ namespace GFGGame
             {
                 EffectUIPool.Recycle(v.Value);
             }
+            _effectUIDic.Clear();
 
             if (_ui != null)
             {

+ 1 - 2
GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoTaskView.cs

@@ -36,8 +36,7 @@ namespace GFGGame
             modal = true;
 
             _ui.m_itemList.itemRenderer = ListRenderer;
-            //_funcType = TaskFuncType.YuanXiaoActivity;
-            _funcType = TaskFuncType.BattlePass;
+            _funcType = TaskFuncType.YuanXiaoActivity;
         }
 
         protected override void OnShown()

+ 68 - 34
GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoView.cs

@@ -29,6 +29,7 @@ namespace GFGGame
             {
                 EffectUIPool.Recycle(v.Value);
             }
+            _effectUIDic.Clear();
 
             if (_ui != null)
             {
@@ -49,10 +50,8 @@ namespace GFGGame
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("hd_yx_bg_2");
             _ui.m_collectList.itemRenderer = CollectListRenderer;
             _ui.m_btnBack.onClick.Add(OnBtnBack);
-            _effectUIDic.Add("YXJ_Catch", EffectUIPool.CreateEffectUI(_ui.m_catcher.m_getEffect, "ui_Activity", "YXJ_Catch"));
-            _effectUIDic.Add("YXJ_text_start", EffectUIPool.CreateEffectUI(_ui.m_startEffect, "ui_Activity", "YXJ_text_start"));
-            _effectUIDic.Add("YXJ_gameing_bg_tx", EffectUIPool.CreateEffectUI(_ui.m_bgEffect, "ui_Activity", "YXJ_gameing_bg_tx"));
 
+            AddEffect();
         }
 
         protected override void OnShown()
@@ -93,7 +92,7 @@ namespace GFGGame
         /// 初始化元宵的FGUI组件
         /// </summary>
         /// <returns></returns>
-        YuanXiaoItem InitItemUICom()
+        YuanXiaoItem InitYuanXiaoItemUICom()
         {
             GComponent gcom = UIPackage.CreateObject("ActivityGetYuanXiao", "YuanXiaoItem").asCom;
             _ui.m_YuanXiaoParent.target.AddChild(gcom);
@@ -117,19 +116,19 @@ namespace GFGGame
         /// </summary>
         /// <param name="type"></param>
         /// <returns></returns>
-        public YuanXiaoItem Get(int type)
+        public YuanXiaoItem GetYuanXiaoItem(int type)
         {
             YuanXiaoItem item = items.Find(x => x.GetVisible() == false);
             if (item == null)
             {
-                item = InitItemUICom();
+                item = InitYuanXiaoItemUICom();
             }
             item.Init(type);
 
             return item;
         }
 
-        public void Restore(YuanXiaoItem item)
+        public void RestoreYuanXiaoItem(YuanXiaoItem item)
         {
             item.SetVisible(false);
         }
@@ -152,14 +151,14 @@ namespace GFGGame
             {
                 PickUpCfg pickUpCfg = PickUpCfgArray.Instance.GetCfgsByid(_cfg.resArr[0])[_cfg.resIdArr[i] - 1];
                 float time = pickUpCfg.speed * 1f / 1000;
-                YuanXiaoItem item = Get(_cfg.resIdArr[i]);
+                YuanXiaoItem item = GetYuanXiaoItem(_cfg.resIdArr[i]);
                 items.Add(item);
                 int score = pickUpCfg.score;
                 item.SetScore(score);
                 Vector3 startPos = _ui.target.GetChild("start" + roadIndexs[i]).position;
                 Vector3 endPos = startPos;
                 endPos.y = _ui.m_end0.y;
-                item.Move(startPos, endPos, time, () => Restore(item));
+                item.Move(startPos, endPos, time, () => RestoreYuanXiaoItem(item));
             }
 
         }
@@ -195,7 +194,7 @@ namespace GFGGame
         public void GetYuanXiao(YuanXiaoItem item)
         {
             // 回收组件
-            Restore(item);
+            RestoreYuanXiaoItem(item);
 
             if (_countTime == 0)
             {
@@ -235,6 +234,7 @@ namespace GFGGame
 
         public void SetDragRect()
         {
+            _ui.m_catcher.target.visible = true;
             _ui.m_catcher.target.draggable = true;
             _ui.m_catcher.target.dragBounds = new Rect(-_ui.m_catcher.target.width / 2, _ui.m_catcher.target.y, Screen.width + _ui.m_catcher.target.width, 0);
         }
@@ -242,6 +242,7 @@ namespace GFGGame
         private void StartGame()
         {
             CreateItems(null);
+            UpdateTime(null);
             Timers.inst.Add(1, 0, UpdateTime);
             Timers.inst.AddUpdate(UpdateGame);
         }
@@ -265,42 +266,47 @@ namespace GFGGame
 
             _ui.m_time.text = TimeUtil.FormattingTimeTo_mmss(_countTime * 1000);
             --_countTime;
+                
             if (_countTime < 0)
             {
                 Timers.inst.Remove(UpdateTime);
-                GameEnd();
-            }
-        }
 
-        private async void GameEnd()
-        {
-            _ui.m_catcher.target.draggable = false;
-            HideGameView();
-
-            bool win = true;
-            if (_ui.m_c1.selectedIndex == 0)
-            {
-                foreach (var v in _collectDict)
+                bool win = true;
+                if (_ui.m_c1.selectedIndex == 0)
                 {
-                    if (v.Value > 0)
+                    foreach (var v in _collectDict)
                     {
-                        win = false;
-                        break;
+                        if (v.Value > 0)
+                        {
+                            win = false;
+                            break;
+                        }
                     }
                 }
-            }
-            else
-            {
-                if (_score < _cfg.targetScore)
+                else
                 {
-                    win = false;
+                    if (_score < _cfg.targetScore)
+                    {
+                        win = false;
+                    }
                 }
+
+                GameEnd(win);
             }
+        }
+
+        private async void GameEnd(bool win)
+        {
+            //_ui.m_catcher.target.draggable = false;
 
-            //ViewManager.Show<ModalStatusView>("加载中...");
-            //// 请求游戏结束协议
-            //await MiniGameProxy.ReqMiniGameEnd(_cfg.id, _cfg.type, 0, win, _activityID, false);
-            //ViewManager.Hide<ModalStatusView>();
+            // 游戏结束时隐藏catcher,同时也作为游戏结束的标志
+            _ui.m_catcher.target.visible = false;
+            HideGameView();
+
+            ViewManager.Show<ModalStatusView>("加载中...");
+            // 请求游戏结束协议
+            await MiniGameProxy.ReqMiniGameEnd(_cfg.id, _cfg.type, 0, win, _activityID, false);
+            ViewManager.Hide<ModalStatusView>();
 
             if (win)
             {
@@ -358,6 +364,10 @@ namespace GFGGame
         private void UpdateScore()
         {
             _ui.m_progress.SetVar("cur", _score.ToString()).SetVar("target", _cfg.targetScore.ToString()).FlushVars();
+            if (_ui.m_catcher.target.visible && _score >= _cfg.targetScore)
+            {
+                GameEnd(true);
+            }
         }
 
         private void UpdateCollectProgress(int collectType)
@@ -372,6 +382,19 @@ namespace GFGGame
                 --_collectDict[collectType];
             }
             _ui.m_collectList.numItems = _cfg.targetIdArr.Length;
+
+            foreach (var v in _collectDict)
+            {
+                if (v.Value > 0)
+                {
+                    return;
+                }
+            }
+
+            if(_ui.m_catcher.target.visible)
+            {
+                GameEnd(true);
+            }
         }
 
         private void CollectListRenderer(int index, GObject item)
@@ -450,6 +473,10 @@ namespace GFGGame
             }
         }
 
+        /// <summary>
+        /// 计时器,每隔一段时间创建掉落的元宵
+        /// </summary>
+        /// <param name="param"></param>
         private void UpdateGame(object param)
         {
             if (_gamePause)
@@ -463,5 +490,12 @@ namespace GFGGame
                 _timer = 0;
             }
         }
+
+        private void AddEffect()
+        {
+            _effectUIDic.Add("YXJ_Catch", EffectUIPool.CreateEffectUI(_ui.m_catcher.m_getEffect, "ui_Activity", "YXJ_Catch"));
+            _effectUIDic.Add("YXJ_text_start", EffectUIPool.CreateEffectUI(_ui.m_startEffect, "ui_Activity", "YXJ_text_start"));
+            _effectUIDic.Add("YXJ_gameing_bg_tx", EffectUIPool.CreateEffectUI(_ui.m_bgEffect, "ui_Activity", "YXJ_gameing_bg_tx"));
+        }
     }
 }

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/ClothingDecompose/ClothingDecomposeView.cs

@@ -112,6 +112,7 @@ namespace GFGGame
         private void OnClickBtnRarity(int rarity)
         {
             _curRarity = rarity;
+            _ui.m_clothesType.selectedIndex = _curRarity - 1;
             if (_ui.m_c1.selectedIndex == 0)
                 _clothingDatas = DecomposeDataManager.Instance.GetDecomposeDataByRarity(rarity);
             else if (_ui.m_c1.selectedIndex == 1)

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Common/Controller/ValueBarController.cs

@@ -207,7 +207,7 @@ namespace GFGGame
                 button.target.text = "" + ItemDataManager.GetItemNum(itemId);
             }
             
-            button.target.icon = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(itemId).res);
+            //button.target.icon = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(itemId).res);
             button.target.icon = ResPathUtil.GetIconPath(ItemCfgArray.Instance.GetCfg(itemId).res,"png");
             switch (itemId)
             {

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Views/League/LeagueCreatView.cs

@@ -95,6 +95,8 @@ namespace GFGGame
             bool result = await LeagueSproxy.ReqCreateLeague(leagueName, GlobalCfgArray.globalCfg.badgeResArr[_ui.m_listIcon.selectedIndex]);
             if (result)
             {
+                this.Hide();
+                ViewManager.DeleteViewStackCountDown(null,1);
                 ViewManager.Show<LeagueView>(null, true);
             }
         }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/League/LeagueJoinView.cs

@@ -142,8 +142,8 @@ namespace GFGGame
                 bool result = await LeagueSproxy.ReqJoinLeague(leagueId);
                 if (result)
                 {
+                    ViewManager.DeleteViewStackCountDown(null, 1);
                     ViewManager.Show<LeagueView>();
-                    OnBtnBackClick();
                 }
             }
         }

+ 9 - 1
GameClient/Assets/Game/HotUpdate/Views/League/LeagueView.cs

@@ -84,6 +84,8 @@ namespace GFGGame
             EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
             EventAgent.AddEventListener(ConstMessage.NOTICE_CHAT_MESSAGE, UpdateRedChatBtn);
             EventAgent.AddEventListener(ConstMessage.OPEN_CHAT_MESSAGE, UpdateRedChatBtn);
+            EventAgent.AddEventListener(ConstMessage.GET_LEAGUE_INFO, UpdateRedGiftBtn);
+            
         }
 
         protected override void OnShown()
@@ -113,6 +115,7 @@ namespace GFGGame
             EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
             EventAgent.RemoveEventListener(ConstMessage.NOTICE_CHAT_MESSAGE, UpdateRedChatBtn);
             EventAgent.RemoveEventListener(ConstMessage.OPEN_CHAT_MESSAGE, UpdateRedChatBtn);
+            EventAgent.RemoveEventListener(ConstMessage.GET_LEAGUE_INFO, UpdateRedGiftBtn);
         }
 
         private void OnBtnBackClick()
@@ -250,9 +253,14 @@ namespace GFGGame
         private void UpdateRedDot()
         {
             RedDotController.Instance.SetComRedDot(_ui.m_btnMember.target, RedDotDataManager.Instance.GetLeagueMemberJoinRed());
-            RedDotController.Instance.SetComRedDot(_ui.m_btnGift.target, RedDotDataManager.Instance.GetLeagueGiftBoxRed(), "", -120, 100);
             RedDotController.Instance.SetComRedDot(_ui.m_btnPray.target, RedDotDataManager.Instance.GetLeaguePrayRed(), "", -70, 60);
             RedDotController.Instance.SetComRedDot(_ui.m_btnParty.target, RedDotDataManager.Instance.GetLeagueTeaPartyRed(), "", -440, 60);
+            UpdateRedGiftBtn();
+        }
+
+        private void UpdateRedGiftBtn()
+        {
+            RedDotController.Instance.SetComRedDot(_ui.m_btnGift.target, RedDotDataManager.Instance.GetLeagueGiftBoxRed(), "", -120, 100);
         }
 
         private void UpdateRedChatBtn()

+ 8 - 5
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -273,7 +273,11 @@ namespace GFGGame
                 RefreshBtnNewYearRedEnvelope();
             }
 
-            RefreshBtnYuanXiaoActivity();
+            result = await ActivityGetYuanXiaoProxy.ReqGetActivityGameInfos();
+            if (result)
+            {
+                RefreshBtnYuanXiaoActivity();
+            }
         }
 
         private void RefreshBtnNewYearRedEnvelope()
@@ -284,8 +288,7 @@ namespace GFGGame
 
         private void RefreshBtnYuanXiaoActivity()
         {
-            //_ui.m_btnGetYuanXiao.target.visible = ActivityGetYuanXiaoDataManager.Instance.CheckOpen();
-            _ui.m_btnGetYuanXiao.target.visible = true;
+            _ui.m_btnGetYuanXiao.target.visible = ActivityGetYuanXiaoDataManager.Instance.CheckOpen();
         }
 
         private void AddEffect()
@@ -1014,8 +1017,8 @@ namespace GFGGame
             {
                 if (redPointUpdateFrame == 22)
                 {
-                    //RedDotController.Instance.SetComRedDot(_ui.m_btnGetYuanXiao.target
-                    //    , RedDotDataManager.Instance.GetActivityYuanXiaoRed(), "", 0, 0);
+                    RedDotController.Instance.SetComRedDot(_ui.m_btnGetYuanXiao.target
+                        , RedDotDataManager.Instance.GetActivityYuanXiaoRed(), "", 0, 0);
 
                 }
             }

BIN
GameClient/Assets/ResIn/UI/ActivityGetYuanXiao/ActivityGetYuanXiao_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/ActivityGetYuanXiao/ActivityGetYuanXiao_atlas0.png


BIN
GameClient/Assets/ResIn/UI/ActivityGetYuanXiao/ActivityGetYuanXiao_fui.bytes


BIN
GameClient/Assets/ResIn/UI/ClothingDecompose/ClothingDecompose_fui.bytes


BIN
GameClient/Assets/ResIn/UI/MiniGame/MiniGame_fui.bytes


BIN
GameClient/Assets/ResIn/UI/Store/Store_fui.bytes