瀏覽代碼

摘星流程修改

huangxiaoyue 1 年之前
父節點
當前提交
0c15e142fc

+ 6 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_Component2.cs

@@ -15,6 +15,8 @@ namespace UI.LuckyBox
         public GLoader m_rarity;
         public GImage m_imgNew;
         public GTextField m_txtName;
+        public Transition m_t0;
+        public Transition m_t1;
         public const string URL = "ui://drx9d1usdcrotaa";
         public const string PACKAGE_NAME = "LuckyBox";
         public const string RES_NAME = "Component2";
@@ -70,6 +72,8 @@ namespace UI.LuckyBox
             m_rarity = (GLoader)comp.GetChild("rarity");
             m_imgNew = (GImage)comp.GetChild("imgNew");
             m_txtName = (GTextField)comp.GetChild("txtName");
+            m_t0 = comp.GetTransition("t0");
+            m_t1 = comp.GetTransition("t1");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -81,6 +85,8 @@ namespace UI.LuckyBox
             m_rarity = null;
             m_imgNew = null;
             m_txtName = null;
+            m_t0 = null;
+            m_t1 = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_LuckBoxBonusShowUI.cs

@@ -24,6 +24,7 @@ namespace UI.LuckyBox
         public UI_LuckyBoxBonusShowItem m_item8;
         public UI_LuckyBoxBonusShowItem m_item9;
         public GButton m_BtnPass;
+        public GGraph m_touchFlipOpen;
         public Transition m_t0;
         public Transition m_t1;
         public const string URL = "ui://drx9d1use050tf3";
@@ -90,6 +91,7 @@ namespace UI.LuckyBox
             m_item8 = (UI_LuckyBoxBonusShowItem)UI_LuckyBoxBonusShowItem.Create(comp.GetChild("item8"));
             m_item9 = (UI_LuckyBoxBonusShowItem)UI_LuckyBoxBonusShowItem.Create(comp.GetChild("item9"));
             m_BtnPass = (GButton)comp.GetChild("BtnPass");
+            m_touchFlipOpen = (GGraph)comp.GetChild("touchFlipOpen");
             m_t0 = comp.GetTransition("t0");
             m_t1 = comp.GetTransition("t1");
         }
@@ -123,6 +125,7 @@ namespace UI.LuckyBox
             m_item9.Dispose();
             m_item9 = null;
             m_BtnPass = null;
+            m_touchFlipOpen = null;
             m_t0 = null;
             m_t1 = null;
             if(disposeTarget && target != null)

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_LuckyBoxBonusShowItem.cs

@@ -9,6 +9,7 @@ namespace UI.LuckyBox
         public GComponent target;
         public UI_Component2 m_comIcon;
         public Transition m_t0;
+        public Transition m_t1;
         public const string URL = "ui://drx9d1use050tf4";
         public const string PACKAGE_NAME = "LuckyBox";
         public const string RES_NAME = "LuckyBoxBonusShowItem";
@@ -58,12 +59,14 @@ namespace UI.LuckyBox
         {
             m_comIcon = (UI_Component2)UI_Component2.Create(comp.GetChild("comIcon"));
             m_t0 = comp.GetTransition("t0");
+            m_t1 = comp.GetTransition("t1");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_comIcon.Dispose();
             m_comIcon = null;
             m_t0 = null;
+            m_t1 = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 74 - 31
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxBonusShowView.cs

@@ -14,12 +14,12 @@ namespace GFGGame
         private Dictionary<int , Dictionary<int, EffectUI>> _effListTen = new Dictionary<int, Dictionary<int, EffectUI>>();
         private Dictionary<int, EffectUI> _effList = new Dictionary<int, EffectUI>();
 
-        Dictionary<int, int> _itemIdList = new Dictionary<int, int>();
-        Dictionary<int, GComponent> _itemObjList = new Dictionary<int, GComponent>();
-        List<int> _recordOpenIndex = new List<int>();  //记录打开过得item位置
+        private Dictionary<int, int> _itemIdList = new Dictionary<int, int>();
+        private Dictionary<int, GComponent> _itemObjList = new Dictionary<int, GComponent>();
+        private List<int> _recordOpenIndex = new List<int>();  //记录打开过得item位置
+        private int _chooseIndex = -1;  //当前选中的index
         private int _countShow = 0;   //第几次展示
         private int _countNewRecord = 0;  //展示步骤
-        private bool touchFlipOpen = true;   //禁用点击
 
         private EffectUI _effectUI1;
         private EffectUI _effectUI2;
@@ -96,6 +96,7 @@ namespace GFGGame
             _itemObjList.Clear();
             _recordOpenIndex.Clear();
             _ui.m_BtnPass.visible = true;
+            _ui.m_touchFlipOpen.touchable = false;
 
             if (_rewardList.Count == 1)
             {
@@ -110,6 +111,9 @@ namespace GFGGame
                     UpdateItem(_ui.target.GetChild("item" + i).asCom, i, 10);
                 }
             }
+
+            if(_chooseIndex != -1)
+                HandClickItem(_chooseIndex);
         }
 
         protected override void OnHide()
@@ -130,6 +134,7 @@ namespace GFGGame
             item.m_comIcon.m_txtName.text = itemCfg.name;
             item.m_comIcon.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
             item.m_comIcon.m_FlipOpenType.selectedIndex = 1;
+            item.m_comIcon.m_t1.Play();
 
             //带特效的处理先注释
             //item.m_comIcon.m_holder.visible = false;
@@ -196,48 +201,45 @@ namespace GFGGame
         {
             GObject obj = context.sender as GObject;
             int index = (int)obj.data;
-            TouchClickItem(index);
-            Timers.inst.Add(1f, 0, UpClickDataTime,index);
+            _chooseIndex = index;
+            HandClickItem(index);
         }
 
-        void TouchClickItem(int index)
+        private void HandClickItem(int index)
         {
-            if (!touchFlipOpen)
-                return;
-
+            _ui.m_touchFlipOpen.touchable = false;
             ClickItem(index);
+            Timers.inst.Add(1f, 1, UpClickDataTime,index);
         }
 
         void ClickItem(int index)
         {
-            if (!_recordOpenIndex.Contains(index)) {
-
-                //touchFlipOpen = false;
-
+            if (!_recordOpenIndex.Contains(index))
+            {
                 UI_LuckyBoxBonusShowItem item = UI_LuckyBoxBonusShowItem.Proxy(_itemObjList[index]);
-                item.m_comIcon.m_FlipOpenType.selectedIndex = 0;
-
-                if (_recordOpenIndex.Count >= _rewardList.Count)
+                if (_recordOpenIndex.Count >= _rewardList.Count - 1)
                     _ui.m_BtnPass.visible = false;
 
                 //先翻开牌面
-                if (!item.m_comIcon.m_imgNew.visible)
+                if (!item.m_comIcon.m_imgNew.visible || _countNewRecord < 1)
                 {
+                    if (!item.m_comIcon.m_imgNew.visible) { 
+                        _ui.m_touchFlipOpen.touchable = false;
+                        _recordOpenIndex.Add(index);
+                    }
+                    else if (_countNewRecord < 1)
+                        _countNewRecord += 1;
+
                     HideOtherShowWindow();
-                    _recordOpenIndex.Add(index);
-                    touchFlipOpen = true;
+                    item.m_comIcon.m_FlipOpenType.selectedIndex = 0;
+                    item.m_t1.Play();
+                    item.m_comIcon.m_t0.Play();
                     return;
                 }
-                else {
-                    if (_countNewRecord <= 1) {
-                        HideOtherShowWindow();
-                        _countNewRecord += 1;
-                        return;
-                    }
-                }
 
                 if (item.m_comIcon.m_imgNew.visible && _countNewRecord >= 1)
                 {
+                    Timers.inst.Remove(UpClickDataTime);
                     //判断是否有套装需要展示
                     if (GetSuitItemController.GetSuitWaitingToId(_itemIdList[index]))
                     {
@@ -255,7 +257,6 @@ namespace GFGGame
                             ViewManager.Hide<LuckyBoxNewCardView>();
                             GetSuitItemController.TryShow(_itemIdList[index]);
                             _recordOpenIndex.Add(index);
-                            touchFlipOpen = true;
                             _countShow = 0;
                             _countNewRecord = 0;
                         }
@@ -267,31 +268,72 @@ namespace GFGGame
                         _rewardItemList.Add(_rewardList[index]);
                         ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
                         _recordOpenIndex.Add(index);
-                        touchFlipOpen = true;
                         _countNewRecord = 0;
                     }
                 }
                 UI_LuckyBoxBonusShowItem.ProxyEnd();
             }
-            else
+            else{
                 GoodsItemTipsController.ShowItemTips(_itemIdList[index]);
+            }
         }
 
         private void OnClickLoaBg()
         {
             if (_recordOpenIndex.Count >= _rewardList.Count)
+            {
+                _chooseIndex = -1;
                 this.Hide();
+            }
+            else {
+                for (int index = 0; index < _rewardList.Count; index++)
+                {
+                    if (!_recordOpenIndex.Contains(index))
+                    {
+                        _chooseIndex = index;
+                        HandClickItem(index);
+                        break;
+                    }
+                }
+            }
         }
 
         private void OnClickBtnPass()
         {
+            for (int index = 0; index < _rewardList.Count; index++)
+            {
+                if (!_recordOpenIndex.Contains(index))
+                {
+                    int count = 0;
+                    bool isFirst = false;
+                    for (int i = 0; i < _rewardList.Count; i++)
+                    {
+                        if (_rewardList[i].id == _rewardList[index].id) count++;
+                        if (count == 1 && i == index) isFirst = true;
+                    }
+                    bool open = count == ItemDataManager.GetItemNum(_rewardList[index].id) && isFirst;
+
+                    if (!open)
+                    {
+                        _chooseIndex = index;
+                        ClickItem(index);
+                    }
+                }
+            }
+            ClickPass();
+        }
+
+        private void ClickPass()
+        {
+            _ui.m_touchFlipOpen.touchable = false;
             Timers.inst.Add(1f, 0, UpDataTime);
         }
 
         private void UpDataTime(object param = null)
         {
-            if (_recordOpenIndex.Count >= _rewardList.Count) { 
+            if (_recordOpenIndex.Count >= _rewardList.Count) {
                 Timers.inst.Remove(UpDataTime);
+                _ui.m_touchFlipOpen.touchable = false;
                 HideOtherShowWindow();
             }
 
@@ -310,6 +352,7 @@ namespace GFGGame
             if (_recordOpenIndex.Contains(index))
             {
                 Timers.inst.Remove(UpClickDataTime);
+                _ui.m_touchFlipOpen.touchable = false;
                 HideOtherShowWindow();
             }
             else

二進制
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_atlas0!a.png


二進制
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_atlas0.png


二進制
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_atlas0_1!a.png


二進制
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_atlas0_1.png


二進制
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_fui.bytes