Răsfoiți Sursa

抽奖跳过

zhaoyang 2 ani în urmă
părinte
comite
7eea0376e9

+ 4 - 1
FGUIProject/assets/LuckyBox/LuckBoxBonusUI.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1920">
-  <controller name="c1" pages="0,,1," selected="0"/>
+  <controller name="c1" pages="0,,1," selected="1"/>
   <displayList>
     <loader id="n17_gbqo" name="loaBg" xy="540,960" pivot="0.5,0.5" anchor="true" size="1080,2400" fill="scaleMatchWidth">
       <relation target="" sidePair="width-width,height-height,center-center,middle-middle"/>
@@ -25,6 +25,9 @@
       <gearDisplay controller="c1" pages="1"/>
       <relation target="" sidePair="center-center,middle-middle"/>
     </group>
+    <component id="n20_dhoa" name="btnPass" src="qdrt1c" fileName="components/Button4.xml" xy="808,1766">
+      <relation target="" sidePair="right-right,bottom-bottom"/>
+    </component>
     <loader id="n19_v95q" name="loaMask" xy="540,960" pivot="0.5,0.5" anchor="true" size="1080,2400" fill="scaleMatchWidth">
       <relation target="" sidePair="width-width,height-height,center-center,middle-middle"/>
     </loader>

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

@@ -23,6 +23,7 @@ namespace UI.LuckyBox
         public UI_LuckyBoxBonusItem m_item9;
         public GGroup m_grpItems;
         public GLoader m_loaMask;
+        public GButton m_btnPass;
         public Transition m_t0;
         public Transition m_t1;
         public const string URL = "ui://drx9d1usfka7a";
@@ -88,6 +89,7 @@ namespace UI.LuckyBox
             m_item9 = (UI_LuckyBoxBonusItem)UI_LuckyBoxBonusItem.Create(comp.GetChild("item9"));
             m_grpItems = (GGroup)comp.GetChild("grpItems");
             m_loaMask = (GLoader)comp.GetChild("loaMask");
+            m_btnPass = (GButton)comp.GetChild("btnPass");
             m_t0 = comp.GetTransition("t0");
             m_t1 = comp.GetTransition("t1");
         }
@@ -120,6 +122,7 @@ namespace UI.LuckyBox
             m_item9 = null;
             m_grpItems = null;
             m_loaMask = null;
+            m_btnPass = null;
             m_t0 = null;
             m_t1 = null;
             if(disposeTarget && target != null)

+ 67 - 14
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxBonusView.cs

@@ -11,6 +11,9 @@ namespace GFGGame
         private List<ItemData> itemList;
         private GComponent _curComItem;
         private int openCount = 0;
+        private List<ItemData> newItemList = new List<ItemData>();
+        private List<int> newCardList = new List<int>();
+        private List<int> openIndexList = new List<int>();
 
         private List<GameObject> _effects = new List<GameObject>();
         private List<GoWrapper> _wrappers = new List<GoWrapper>();
@@ -46,6 +49,7 @@ namespace GFGGame
             _ui.m_loaBg.onClick.Add(OnClickBg);
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("bj_ckzxin");
             _ui.m_loaOpen.onClick.Add(OnClickOpen);
+            _ui.m_btnPass.onClick.Add(OnBtnPassClick);
         }
 
         protected override void OnShown()
@@ -82,6 +86,7 @@ namespace GFGGame
             // _ui.m_itemOne.target.visible = false;
             _ui.m_t1.Play();
             openCount = 0;
+            Timers.inst.Remove(UpdateTime);
         }
 
         private void OnClickBg()
@@ -118,19 +123,6 @@ namespace GFGGame
             }
         }
 
-        // private void HideAllItem()
-        // {
-        //     _ui.m_itemOne.target.visible = false;
-        //     for (int i = 0; i < 10; i++)
-        //     {
-        //         GObject itemObject = _ui.target.GetChild("item" + i);
-        //         if (itemObject != null)
-        //         {
-        //             itemObject.visible = false;
-        //         }
-        //     }
-        // }
-
         private void UpdateItem(int index, GObject obj)
         {
             ItemData itemData = itemList[index];
@@ -211,6 +203,8 @@ namespace GFGGame
                 }
             }
         }
+
+
         private bool PlayOpenAni(GComponent component)
         {
             Transition transition = component.GetTransition("t1");
@@ -240,7 +234,7 @@ namespace GFGGame
                 }
                 else if (cfg.itemType == ConstItemType.CARD)
                 {
-                    ViewManager.Show<LuckyBoxNewCardView>(itemData.id);
+                    ViewManager.Show<LuckyBoxNewCardView>(new object[] { itemData.id });
                 }
             }
             openCount++;
@@ -258,5 +252,64 @@ namespace GFGGame
             GoodsItemTipsController.ShowItemTips(itemID);
         }
 
+
+        private void OnBtnPassClick()
+        {
+            _ui.m_loaMask.visible = true;
+            if (itemList.Count == 1)
+            {
+                PlayOpenAni(_ui.m_itemOne.target);
+            }
+            else
+            {
+                Timers.inst.Add(0.5f, itemList.Count, UpdateTime);
+            }
+
+        }
+        private void UpdateTime(object param)
+        {
+            GComponent component = _ui.target.GetChild("item" + openCount).asCom;
+            Transition transition = component.GetTransition("t1");
+            GComponent comIcon = component.GetChild("comIcon").asCom;
+            GImage imgNew = comIcon.GetChild("imgNew").asImage;
+            openCount++;
+            if (transition.playing || comIcon.skew == Vector2.zero) return;
+            if (imgNew.visible)
+            {
+                ItemData itemData = component.data as ItemData;
+                ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemData.id);
+                if (cfg.itemType == ConstItemType.DRESS_UP)
+                {
+                    newItemList.Add(itemData);
+                }
+                else if (cfg.itemType == ConstItemType.CARD)
+                {
+                    newCardList.Add(itemData.id);
+                }
+            }
+            if (openCount == itemList.Count)
+            {
+                transition.Play(PlayComplete);
+            }
+            else
+            {
+                transition.Play();
+            }
+
+        }
+        private void PlayComplete()
+        {
+            _ui.m_loaMask.visible = false;
+            _ui.m_loaOpen.visible = false;
+            if (newItemList.Count > 0)
+            {
+                ViewManager.Show<LuckyBoxNewDressView>(new object[] { newItemList });
+            }
+            if (newCardList.Count > 0)
+            {
+                ViewManager.Show<LuckyBoxNewCardView>(newCardList);
+            }
+
+        }
     }
 }

+ 23 - 6
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxNewCardView.cs

@@ -1,3 +1,4 @@
+using System.Collections.Generic;
 using ET;
 using FairyGUI;
 using UI.LuckyBox;
@@ -8,7 +9,7 @@ namespace GFGGame
     public class LuckyBoxNewCardView : BaseWindow
     {
         private UI_LuckyBoxNewCardUI _ui;
-
+        private List<int> _newCardList;
         public override void Dispose()
         {
             if (_ui != null)
@@ -27,7 +28,7 @@ namespace GFGGame
             this.viewCom = _ui.target;
             isfullScreen = true;
 
-            _ui.m_loaBg.onClick.Add(this.Hide);
+            _ui.m_loaBg.onClick.Add(OnClickBtnBg);
         }
         protected override void AddEventListener()
         {
@@ -37,13 +38,17 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            int cardId = (int)this.viewData;
-            ItemCfg cfg = ItemCfgArray.Instance.GetCfg(cardId);
+            _newCardList = this.viewData as List<int>;
 
-            _ui.m_loaBg.url = ResPathUtil.GetCardPath(cfg.res);
 
-        }
 
+        }
+        private void updateView()
+        {
+            ItemCfg cfg = ItemCfgArray.Instance.GetCfg(_newCardList[0]);
+            _ui.m_loaBg.url = ResPathUtil.GetCardPath(cfg.res);
+            _newCardList.RemoveAt(0);
+        }
         protected override void OnHide()
         {
             base.OnHide();
@@ -55,5 +60,17 @@ namespace GFGGame
             base.RemoveEventListener();
 
         }
+
+        private void OnClickBtnBg()
+        {
+            if (_newCardList.Count > 0)
+            {
+                updateView();
+            }
+            else
+            {
+                this.Hide();
+            }
+        }
     }
 }

BIN
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_fui.bytes