zhaoyang 2 лет назад
Родитель
Сommit
f31fcfb548
23 измененных файлов с 568 добавлено и 249 удалено
  1. 6 5
      FGUIProject/assets/DressUp/comListType.xml
  2. 2 31
      FGUIProject/assets/LuckyBox/LuckyBoxUI.xml
  3. 9 9
      FGUIProject/assets/LuckyBox/combox/ComBox_1.xml
  4. 9 9
      FGUIProject/assets/LuckyBox/combox/ComBox_2.xml
  5. 8 8
      FGUIProject/assets/LuckyBox/combox/ComBox_3.xml
  6. 3 3
      FGUIProject/assets/LuckyBox/components/Button3.xml
  7. 4 4
      FGUIProject/assets/LuckyBox/package.xml
  8. 1 0
      GameClient/Assets/Game/HotUpdate/Controller/GuideController.cs
  9. 20 18
      GameClient/Assets/Game/HotUpdate/Data/LuckyBoxDataManager.cs
  10. 3 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/DressUp/UI_PartsList.cs
  11. 104 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_ComBox_1.cs
  12. 11 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_ComBox_1.cs.meta
  13. 104 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_ComBox_2.cs
  14. 11 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_ComBox_2.cs.meta
  15. 104 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_ComBox_3.cs
  16. 11 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_ComBox_3.cs.meta
  17. 1 40
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_LuckyBoxUI.cs
  18. 0 1
      GameClient/Assets/Game/HotUpdate/Views/Common/Controller/ValueBarController.cs
  19. 4 3
      GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxPreShowView.cs
  20. 153 118
      GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs
  21. BIN
      GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_atlas0!a.png
  22. BIN
      GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_atlas0.png
  23. BIN
      GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_fui.bytes

+ 6 - 5
FGUIProject/assets/DressUp/comListType.xml

@@ -1,15 +1,16 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="250,1920">
+<component size="276,1920">
   <displayList>
-    <image id="n15_wono" name="n15" src="wonoe4" fileName="images/hz_zdikuang_1.png" xy="0,94" size="226,1826">
-      <relation target="" sidePair="width-width,height-height"/>
+    <image id="n15_wono" name="n15" src="wonoe4" fileName="images/hz_zdikuang_1.png" xy="13,94" size="226,1826" group="n17_wono">
+      <relation target="" sidePair="height-height"/>
     </image>
-    <list id="n14_k6he" name="listType" xy="0,164" size="216,1757" overflow="scroll" lineGap="40" defaultItem="ui://mbo439wbk6he16" align="center" autoClearItems="true" scrollItemToViewOnClick="false">
+    <list id="n14_k6he" name="listType" xy="13,164" size="216,1757" group="n17_wono" overflow="scroll" lineGap="40" defaultItem="ui://mbo439wbk6he16" align="center" autoClearItems="true" scrollItemToViewOnClick="false">
       <relation target="" sidePair="bottomext-bottom"/>
       <item/>
       <item/>
       <item/>
     </list>
-    <image id="n16_wono" name="n16" src="wonoe6" fileName="images/hz_zdikuang_2.png" xy="-13,72"/>
+    <image id="n16_wono" name="n16" src="wonoe6" fileName="images/hz_zdikuang_2.png" xy="0,72" group="n17_wono"/>
+    <group id="n17_wono" name="n17" xy="0,72" size="276,1849"/>
   </displayList>
 </component>

+ 2 - 31
FGUIProject/assets/LuckyBox/LuckyBoxUI.xml

@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1920">
-  <controller name="c1" pages="0,,1,,2," selected="0"/>
   <displayList>
-    <list id="n23_vek8" name="listBg" xy="0,0" size="1080,1920" pageController="c1" layout="row" overflow="scroll" scroll="horizontal" scrollBarFlags="154" defaultItem="ui://drx9d1usvek811">
+    <list id="n23_vek8" name="listBg" xy="0,0" size="1080,1920" layout="row" overflow="scroll" scroll="horizontal" scrollBarFlags="154" defaultItem="ui://drx9d1usvek811">
       <relation target="" sidePair="height-height,center-center,middle-middle"/>
     </list>
     <component id="n6_fka7" name="btnBack" src="9xlo8" fileName="components/ButtonBack1.xml" pkg="eg2y0ldp" xy="35,80" group="n32_vek8"/>
@@ -10,35 +9,7 @@
     <component id="n3_fka7" name="valueBar" src="v3541v" fileName="components/ComponentValueBar.xml" pkg="eg2y0ldp" xy="159,90" group="n32_vek8">
       <relation target="" sidePair="right-right"/>
     </component>
-    <component id="n8_fka7" name="btnPreview" src="ga16d" fileName="components/Button3.xml" xy="862,177" group="n32_vek8" controller="c1,0">
-      <Button icon="ui://drx9d1usvek8v"/>
-    </component>
-    <component id="n22_vek8" name="btnExchange" src="ga16d" fileName="components/Button3.xml" xy="966,177" group="n32_vek8">
-      <Button icon="ui://drx9d1usvek8t"/>
-    </component>
-    <image id="n9_ga16" name="n9" src="fka75" fileName="images/cj_dikuangtw.png" xy="854,290" group="n32_vek8"/>
-    <text id="n17_ga16" name="txtOwned" xy="905,288" size="122,36" group="n32_vek8" fontSize="26" color="#fff7ea" align="center" vars="true" text="已拥有:{v1=0}">
-      <relation target="n9_ga16" sidePair="center-center,middle-middle"/>
-    </text>
-    <group id="n32_vek8" name="grpTop" xy="35,80" size="1045,244" advanced="true"/>
-    <component id="n28_vek8" name="comCostOne" src="vek812" fileName="components/ComCost.xml" xy="302,1695" pivot="0.5,0" anchor="true" group="n31_vek8">
-      <relation target="" sidePair="left-left"/>
-    </component>
-    <component id="n30_vek8" name="comCostTen" src="vek812" fileName="components/ComCost.xml" xy="787,1695" pivot="0.5,0" anchor="true" group="n31_vek8">
-      <relation target="" sidePair="left-left"/>
-    </component>
-    <component id="n10_ga16" name="btnBuyOne" src="ga16b" fileName="components/Button1.xml" xy="91,1748" group="n31_vek8"/>
-    <component id="n11_ga16" name="btnBuyTen" src="ga16c" fileName="components/Button2.xml" xy="577,1748" group="n31_vek8"/>
-    <image id="n21_ga16" name="imgSpecial" src="ga16i" fileName="images/cj_anniu_ts.png" xy="919,1663" group="n31_vek8">
-      <gearDisplay controller="c1" pages="0"/>
-      <relation target="n11_ga16" sidePair="left-left,top-top"/>
-    </image>
-    <text id="n16_ga16" name="txtRemainTimes" xy="540,1869" pivot="0.5,0" anchor="true" size="248,44" group="n31_vek8" fontSize="32" color="#fff7d4" align="center" vars="true" text="今日剩余次数:{v1=0}">
-      <relation target="" sidePair="center-center"/>
-    </text>
-    <group id="n31_vek8" name="grpBottom" xy="91,1663" size="989,250" advanced="true">
-      <relation target="" sidePair="bottom-bottom"/>
-    </group>
+    <group id="n32_vek8" name="grpTop" xy="35,80" size="1204,236" advanced="true"/>
     <component id="n33_ly9g" name="btnLeft" src="ly9g1e" fileName="components/Button13.xml" pkg="eg2y0ldp" xy="74,960" pivot="0.5,0.5" anchor="true" rotation="180"/>
     <component id="n39_ly9g" name="btnRight" src="ly9g1e" fileName="components/Button13.xml" pkg="eg2y0ldp" xy="1000,960" pivot="0.5,0.5" anchor="true"/>
   </displayList>

+ 9 - 9
FGUIProject/assets/LuckyBox/combox/ComBox_1.xml

@@ -17,23 +17,23 @@
     <group id="n36_njmn" name="n36" xy="854,177" size="226,147" advanced="true">
       <relation target="" sidePair="right-right,top-top"/>
     </group>
-    <component id="n26_njmn" name="comCostOne" src="vek812" fileName="components/ComCost.xml" xy="256,1695" pivot="0.5,0" anchor="true" group="n31_njmn">
+    <component id="n26_njmn" name="comCostOne" src="vek812" fileName="components/ComCost.xml" xy="256,1635" pivot="0.5,0" anchor="true" group="n31_njmn">
       <relation target="" sidePair="left-left"/>
     </component>
-    <component id="n27_njmn" name="comCostTen" src="vek812" fileName="components/ComCost.xml" xy="741,1695" pivot="0.5,0" anchor="true" group="n31_njmn">
+    <component id="n27_njmn" name="comCostTen" src="vek812" fileName="components/ComCost.xml" xy="741,1635" pivot="0.5,0" anchor="true" group="n31_njmn">
       <relation target="" sidePair="left-left"/>
     </component>
-    <component id="n28_njmn" name="btnBuyOne" src="ga16b" fileName="components/Button1.xml" xy="45,1748" group="n31_njmn"/>
-    <component id="n29_njmn" name="btnBuyTen" src="ga16c" fileName="components/Button2.xml" xy="531,1748" group="n31_njmn"/>
-    <image id="n30_njmn" name="imgSpecial" src="ga16i" fileName="images/cj_anniu_ts.png" xy="873,1663" group="n31_njmn">
+    <component id="n28_njmn" name="btnBuyOne" src="ga16b" fileName="components/Button1.xml" xy="45,1688" group="n31_njmn"/>
+    <component id="n29_njmn" name="btnBuyTen" src="ga16c" fileName="components/Button2.xml" xy="531,1688" group="n31_njmn"/>
+    <image id="n30_njmn" name="imgSpecial" src="ga16i" fileName="images/cj_anniu_ts.png" xy="873,1603" group="n31_njmn">
       <relation target="n29_njmn" sidePair="left-left,top-top"/>
     </image>
-    <group id="n31_njmn" name="n31" xy="45,1663" size="989,190" advanced="true">
-      <relation target="" sidePair="center-center,bottom-bottom"/>
-    </group>
-    <text id="n37_njmn" name="txtRemainTimes" xy="540,1869" pivot="0.5,0" anchor="true" size="248,44" fontSize="32" color="#fff7d4" align="center" vars="true" text="今日剩余次数:{v1=0}">
+    <text id="n37_njmn" name="txtRemainTimes" xy="540,1809" pivot="0.5,0" anchor="true" size="248,44" group="n31_njmn" fontSize="32" color="#fff7d4" align="center" vars="true" text="今日剩余次数:{v1=0}">
       <relation target="" sidePair="center-center"/>
     </text>
+    <group id="n31_njmn" name="n31" xy="45,1603" size="989,250" advanced="true">
+      <relation target="" sidePair="center-center,bottom-bottom"/>
+    </group>
   </displayList>
   <customProperty target="loaBg" propertyId="1"/>
 </component>

+ 9 - 9
FGUIProject/assets/LuckyBox/combox/ComBox_2.xml

@@ -17,23 +17,23 @@
     <group id="n36_njmn" name="n36" xy="854,177" size="226,147" advanced="true">
       <relation target="" sidePair="right-right,top-top"/>
     </group>
-    <component id="n26_njmn" name="comCostOne" src="vek812" fileName="components/ComCost.xml" xy="256,1695" pivot="0.5,0" anchor="true" group="n31_njmn">
+    <component id="n26_njmn" name="comCostOne" src="vek812" fileName="components/ComCost.xml" xy="256,1635" pivot="0.5,0" anchor="true" group="n31_njmn">
       <relation target="" sidePair="left-left"/>
     </component>
-    <component id="n27_njmn" name="comCostTen" src="vek812" fileName="components/ComCost.xml" xy="741,1695" pivot="0.5,0" anchor="true" group="n31_njmn">
+    <component id="n27_njmn" name="comCostTen" src="vek812" fileName="components/ComCost.xml" xy="741,1635" pivot="0.5,0" anchor="true" group="n31_njmn">
       <relation target="" sidePair="left-left"/>
     </component>
-    <component id="n28_njmn" name="btnBuyOne" src="ga16b" fileName="components/Button1.xml" xy="45,1748" group="n31_njmn"/>
-    <component id="n29_njmn" name="btnBuyTen" src="ga16c" fileName="components/Button2.xml" xy="531,1748" group="n31_njmn"/>
-    <image id="n30_njmn" name="imgSpecial" src="ga16i" fileName="images/cj_anniu_ts.png" xy="873,1663" group="n31_njmn">
+    <component id="n28_njmn" name="btnBuyOne" src="ga16b" fileName="components/Button1.xml" xy="45,1688" group="n31_njmn"/>
+    <component id="n29_njmn" name="btnBuyTen" src="ga16c" fileName="components/Button2.xml" xy="531,1688" group="n31_njmn"/>
+    <image id="n30_njmn" name="imgSpecial" src="ga16i" fileName="images/cj_anniu_ts.png" xy="873,1603" group="n31_njmn">
       <relation target="n29_njmn" sidePair="left-left,top-top"/>
     </image>
-    <group id="n31_njmn" name="n31" xy="45,1663" size="989,190" advanced="true">
-      <relation target="" sidePair="center-center,bottom-bottom"/>
-    </group>
-    <text id="n37_njmn" name="txtRemainTimes" xy="540,1869" pivot="0.5,0" anchor="true" size="248,44" fontSize="32" color="#fff7d4" align="center" vars="true" text="今日剩余次数:{v1=0}">
+    <text id="n37_njmn" name="txtRemainTimes" xy="540,1809" pivot="0.5,0" anchor="true" size="248,44" group="n31_njmn" fontSize="32" color="#fff7d4" align="center" vars="true" text="今日剩余次数:{v1=0}">
       <relation target="" sidePair="center-center"/>
     </text>
+    <group id="n31_njmn" name="n31" xy="45,1603" size="989,250" advanced="true">
+      <relation target="" sidePair="center-center,bottom-bottom"/>
+    </group>
   </displayList>
   <customProperty target="loaBg" propertyId="1"/>
 </component>

+ 8 - 8
FGUIProject/assets/LuckyBox/combox/ComBox_3.xml

@@ -20,20 +20,20 @@
     <group id="n37_njmn" name="n37" xy="854,177" size="226,147" advanced="true">
       <relation target="" sidePair="right-right,top-top"/>
     </group>
-    <component id="n26_njmn" name="comCostOne" src="vek812" fileName="components/ComCost.xml" xy="301,1695" pivot="0.5,0" anchor="true" group="n31_njmn">
+    <component id="n26_njmn" name="comCostOne" src="vek812" fileName="components/ComCost.xml" xy="301,1635" pivot="0.5,0" anchor="true" group="n31_njmn">
       <relation target="" sidePair="left-left"/>
     </component>
-    <component id="n27_njmn" name="comCostTen" src="vek812" fileName="components/ComCost.xml" xy="786,1695" pivot="0.5,0" anchor="true" group="n31_njmn">
+    <component id="n27_njmn" name="comCostTen" src="vek812" fileName="components/ComCost.xml" xy="786,1635" pivot="0.5,0" anchor="true" group="n31_njmn">
       <relation target="" sidePair="left-left"/>
     </component>
-    <component id="n28_njmn" name="btnBuyOne" src="ga16b" fileName="components/Button1.xml" xy="90,1748" group="n31_njmn"/>
-    <component id="n29_njmn" name="btnBuyTen" src="ga16c" fileName="components/Button2.xml" xy="576,1748" group="n31_njmn"/>
-    <group id="n31_njmn" name="n31" xy="90,1695" size="898,158" advanced="true">
-      <relation target="" sidePair="center-center,bottom-bottom"/>
-    </group>
-    <text id="n38_njmn" name="txtRemainTimes" xy="540,1869" pivot="0.5,0" anchor="true" size="248,44" fontSize="32" color="#fff7d4" align="center" vars="true" text="今日剩余次数:{v1=0}">
+    <component id="n28_njmn" name="btnBuyOne" src="ga16b" fileName="components/Button1.xml" xy="90,1688" group="n31_njmn"/>
+    <component id="n29_njmn" name="btnBuyTen" src="ga16c" fileName="components/Button2.xml" xy="576,1688" group="n31_njmn"/>
+    <text id="n38_njmn" name="txtRemainTimes" xy="540,1809" pivot="0.5,0" anchor="true" size="248,44" group="n31_njmn" fontSize="32" color="#fff7d4" align="center" vars="true" text="今日剩余次数:{v1=0}">
       <relation target="" sidePair="center-center"/>
     </text>
+    <group id="n31_njmn" name="n31" xy="90,1635" size="898,218" advanced="true">
+      <relation target="" sidePair="center-center,bottom-bottom"/>
+    </group>
   </displayList>
   <customProperty target="loaBg" propertyId="1"/>
 </component>

+ 3 - 3
FGUIProject/assets/LuckyBox/components/Button3.xml

@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="94,95" extention="Button">
   <controller name="button" pages="0,up,1,down" selected="0"/>
-  <controller name="c1" exported="true" pages="0,,1,,2," selected="0"/>
+  <controller name="c1" exported="true" pages="0,,1,,2,,3," selected="2"/>
   <displayList>
     <loader id="n1_vek8" name="icon" xy="0,0" size="94,95" url="ui://drx9d1usvek8v" autoSize="true"/>
     <movieclip id="n2_jpnf" name="n2" src="jpnf1x" fileName="effect/MovieClip1.jta" xy="-53,-11">
-      <gearDisplay controller="c1" pages="1"/>
+      <gearDisplay controller="c1" pages="3"/>
     </movieclip>
     <movieclip id="n3_jpnf" name="n3" src="jpnf26" fileName="effect/MovieClip2.jta" xy="-53,-10">
-      <gearDisplay controller="c1" pages="0"/>
+      <gearDisplay controller="c1" pages="1,2"/>
     </movieclip>
   </displayList>
   <Button/>

+ 4 - 4
FGUIProject/assets/LuckyBox/package.xml

@@ -8,7 +8,6 @@
     <image id="fka75" name="cj_dikuangtw.png" path="/images/" scale="9grid" scale9grid="56,8,112,16"/>
     <image id="fka76" name="cj_jlbj.jpg" path="/images/" atlas="alone_npot"/>
     <image id="fka78" name="cj_yydik.png" path="/images/"/>
-    <component id="fka79" name="LuckyBoxUI.xml" path="/" exported="true"/>
     <component id="fka7a" name="LuckBoxBonusUI.xml" path="/" exported="true"/>
     <component id="ga16b" name="Button1.xml" path="/components/"/>
     <component id="ga16c" name="Button2.xml" path="/components/"/>
@@ -43,9 +42,10 @@
     <image id="qr4e28" name="wpzs_bji.png" path="/images/"/>
     <image id="qr4e29" name="wpzs_yhd.png" path="/images/"/>
     <movieclip id="hibu2m" name="MovieClip3.jta" path="/effect/" atlas="alone_npot"/>
-    <component id="njmn2n" name="ComBox_2.xml" path="/combox/"/>
-    <component id="njmn2o" name="ComBox_3.xml" path="/combox/"/>
-    <component id="njmn2p" name="ComBox_1.xml" path="/combox/"/>
+    <component id="njmn2n" name="ComBox_2.xml" path="/combox/" exported="true"/>
+    <component id="njmn2o" name="ComBox_3.xml" path="/combox/" exported="true"/>
+    <component id="njmn2p" name="ComBox_1.xml" path="/combox/" exported="true"/>
+    <component id="wono2q" name="LuckyBoxUI.xml" path="/" exported="true"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\LuckyBox" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Controller/GuideController.cs

@@ -102,6 +102,7 @@ namespace GFGGame
                         GObject item = (target.asList).GetChildAt(listIndex);
                         if (item != null)
                         {
+                            target.asList.ScrollToView(listIndex);
                             target = item;
                             // target.asList.ScrollToView(listIndex);
                         }

+ 20 - 18
GameClient/Assets/Game/HotUpdate/Data/LuckyBoxDataManager.cs

@@ -17,8 +17,7 @@ namespace GFGGame
 
         private List<ItemData> _rewardsList;//当前奖励,每次抽奖后刷新
         private Dictionary<int, ItemData> _firstRewardsList = new Dictionary<int, ItemData>();//首次获得的奖励
-        public string probShow;
-        private List<LuckyBoxBonusData> _showList;
+        private Dictionary<int, List<LuckyBoxBonusData>> _dicShowList = new Dictionary<int, List<LuckyBoxBonusData>>();
 
         public int[] luckyBoxIds = new int[] { 2, 3 };//奖池列表
         public int startTime = 1635157620;
@@ -62,15 +61,18 @@ namespace GFGGame
                 if (_currentBoxId != value)
                 {
                     _currentBoxId = value;
-                    InitData(_currentBoxId);
+                    // InitData(_currentBoxId);
                 }
             }
         }
-        private void InitData(int boxId)
+        public void InitData(int boxId)
         {
             LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
-            probShow = luckyBoxCfg.probShow;
-            _showList = GetBonusDataList(luckyBoxCfg.bonusShowArr);
+            if (!_dicShowList.ContainsKey(boxId))
+            {
+                _dicShowList[boxId] = GetBonusDataList(luckyBoxCfg.bonusShowArr);
+            }
+            // _showList = GetBonusDataList(luckyBoxCfg.bonusShowArr);
 
         }
         private List<LuckyBoxBonusData> GetBonusDataList(int[] idsList)
@@ -88,10 +90,10 @@ namespace GFGGame
             return list;
         }
 
-        public int GetOwnedCount()
+        public int GetOwnedCount(int boxId)
         {
             int count = 0;
-            foreach (LuckyBoxBonusData luckyBoxBonusData in _showList)
+            foreach (LuckyBoxBonusData luckyBoxBonusData in _dicShowList[boxId])
             {
                 foreach (ItemData itemData in luckyBoxBonusData.itemList)
                 {
@@ -104,21 +106,21 @@ namespace GFGGame
             return count;
         }
 
-        public List<LuckyBoxBonusData> GetCurrentShowList()
+        public List<LuckyBoxBonusData> GetCurrentShowList(int boxId)
         {
-            return _showList.GetRange(0, _showList.Count);
+            return _dicShowList[boxId];
         }
 
 
-        //获取首次获得的服装的列表
-        public List<ItemData> GetFirstClothingList()
-        {
-            ItemData[] cardArray = new ItemData[LuckyBoxDataManager.Instance.FirstRewardList.Count];
-            LuckyBoxDataManager.Instance.FirstRewardList.Values.CopyTo(cardArray, 0);
+        // //获取首次获得的服装的列表
+        // public List<ItemData> GetFirstClothingList()
+        // {
+        //     ItemData[] cardArray = new ItemData[LuckyBoxDataManager.Instance.FirstRewardList.Count];
+        //     LuckyBoxDataManager.Instance.FirstRewardList.Values.CopyTo(cardArray, 0);
 
-            List<ItemData> cardList = new List<ItemData>(cardArray);
-            return cardList;
-        }
+        //     List<ItemData> cardList = new List<ItemData>(cardArray);
+        //     return cardList;
+        // }
 
         public void CheckItemEnough(int boxId, int times, Action onSuccess)
         {

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/DressUp/UI_PartsList.cs

@@ -7,6 +7,7 @@ namespace UI.DressUp
     public partial class UI_PartsList
     {
         public GComponent target;
+        public GImage m_imgTop;
         public GComboBox m_comboBoxRarity;
         public GList m_list;
         public const string URL = "ui://mbo439wbk6he1v";
@@ -56,11 +57,13 @@ namespace UI.DressUp
 
         private void Init(GComponent comp)
         {
+            m_imgTop = (GImage)comp.GetChild("imgTop");
             m_comboBoxRarity = (GComboBox)comp.GetChild("comboBoxRarity");
             m_list = (GList)comp.GetChild("list");
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_imgTop = null;
             m_comboBoxRarity = null;
             m_list = null;
             if(disposeTarget && target != null)

+ 104 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_ComBox_1.cs

@@ -0,0 +1,104 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.LuckyBox
+{
+    public partial class UI_ComBox_1
+    {
+        public GComponent target;
+        public GLoader m_loaBg;
+        public UI_Button3 m_btnPreview;
+        public UI_Button3 m_btnExchange;
+        public GTextField m_txtOwned;
+        public UI_ComCost m_comCostOne;
+        public UI_ComCost m_comCostTen;
+        public UI_Button1 m_btnBuyOne;
+        public UI_Button2 m_btnBuyTen;
+        public GImage m_imgSpecial;
+        public GTextField m_txtRemainTimes;
+        public const string URL = "ui://drx9d1usnjmn2p";
+        public const string PACKAGE_NAME = "LuckyBox";
+        public const string RES_NAME = "ComBox_1";
+        private static UI_ComBox_1 _proxy;
+
+        public static UI_ComBox_1 Create(GObject gObject = null)
+        {
+            var ui = new UI_ComBox_1();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_ComBox_1 Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ComBox_1();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_loaBg = (GLoader)comp.GetChild("loaBg");
+            m_btnPreview = (UI_Button3)UI_Button3.Create(comp.GetChild("btnPreview"));
+            m_btnExchange = (UI_Button3)UI_Button3.Create(comp.GetChild("btnExchange"));
+            m_txtOwned = (GTextField)comp.GetChild("txtOwned");
+            m_comCostOne = (UI_ComCost)UI_ComCost.Create(comp.GetChild("comCostOne"));
+            m_comCostTen = (UI_ComCost)UI_ComCost.Create(comp.GetChild("comCostTen"));
+            m_btnBuyOne = (UI_Button1)UI_Button1.Create(comp.GetChild("btnBuyOne"));
+            m_btnBuyTen = (UI_Button2)UI_Button2.Create(comp.GetChild("btnBuyTen"));
+            m_imgSpecial = (GImage)comp.GetChild("imgSpecial");
+            m_txtRemainTimes = (GTextField)comp.GetChild("txtRemainTimes");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_loaBg = null;
+            m_btnPreview.Dispose();
+            m_btnPreview = null;
+            m_btnExchange.Dispose();
+            m_btnExchange = null;
+            m_txtOwned = null;
+            m_comCostOne.Dispose();
+            m_comCostOne = null;
+            m_comCostTen.Dispose();
+            m_comCostTen = null;
+            m_btnBuyOne.Dispose();
+            m_btnBuyOne = null;
+            m_btnBuyTen.Dispose();
+            m_btnBuyTen = null;
+            m_imgSpecial = null;
+            m_txtRemainTimes = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_ComBox_1.cs.meta

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

+ 104 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_ComBox_2.cs

@@ -0,0 +1,104 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.LuckyBox
+{
+    public partial class UI_ComBox_2
+    {
+        public GComponent target;
+        public GLoader m_loaBg;
+        public UI_Button3 m_btnPreview;
+        public UI_Button3 m_btnExchange;
+        public GTextField m_txtOwned;
+        public UI_ComCost m_comCostOne;
+        public UI_ComCost m_comCostTen;
+        public UI_Button1 m_btnBuyOne;
+        public UI_Button2 m_btnBuyTen;
+        public GImage m_imgSpecial;
+        public GTextField m_txtRemainTimes;
+        public const string URL = "ui://drx9d1usnjmn2n";
+        public const string PACKAGE_NAME = "LuckyBox";
+        public const string RES_NAME = "ComBox_2";
+        private static UI_ComBox_2 _proxy;
+
+        public static UI_ComBox_2 Create(GObject gObject = null)
+        {
+            var ui = new UI_ComBox_2();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_ComBox_2 Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ComBox_2();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_loaBg = (GLoader)comp.GetChild("loaBg");
+            m_btnPreview = (UI_Button3)UI_Button3.Create(comp.GetChild("btnPreview"));
+            m_btnExchange = (UI_Button3)UI_Button3.Create(comp.GetChild("btnExchange"));
+            m_txtOwned = (GTextField)comp.GetChild("txtOwned");
+            m_comCostOne = (UI_ComCost)UI_ComCost.Create(comp.GetChild("comCostOne"));
+            m_comCostTen = (UI_ComCost)UI_ComCost.Create(comp.GetChild("comCostTen"));
+            m_btnBuyOne = (UI_Button1)UI_Button1.Create(comp.GetChild("btnBuyOne"));
+            m_btnBuyTen = (UI_Button2)UI_Button2.Create(comp.GetChild("btnBuyTen"));
+            m_imgSpecial = (GImage)comp.GetChild("imgSpecial");
+            m_txtRemainTimes = (GTextField)comp.GetChild("txtRemainTimes");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_loaBg = null;
+            m_btnPreview.Dispose();
+            m_btnPreview = null;
+            m_btnExchange.Dispose();
+            m_btnExchange = null;
+            m_txtOwned = null;
+            m_comCostOne.Dispose();
+            m_comCostOne = null;
+            m_comCostTen.Dispose();
+            m_comCostTen = null;
+            m_btnBuyOne.Dispose();
+            m_btnBuyOne = null;
+            m_btnBuyTen.Dispose();
+            m_btnBuyTen = null;
+            m_imgSpecial = null;
+            m_txtRemainTimes = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_ComBox_2.cs.meta

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

+ 104 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_ComBox_3.cs

@@ -0,0 +1,104 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.LuckyBox
+{
+    public partial class UI_ComBox_3
+    {
+        public GComponent target;
+        public GLoader m_loaBg;
+        public GLoader m_loaImg;
+        public UI_Button3 m_btnPreview;
+        public UI_Button3 m_btnExchange;
+        public GTextField m_txtOwned;
+        public UI_ComCost m_comCostOne;
+        public UI_ComCost m_comCostTen;
+        public UI_Button1 m_btnBuyOne;
+        public UI_Button2 m_btnBuyTen;
+        public GTextField m_txtRemainTimes;
+        public const string URL = "ui://drx9d1usnjmn2o";
+        public const string PACKAGE_NAME = "LuckyBox";
+        public const string RES_NAME = "ComBox_3";
+        private static UI_ComBox_3 _proxy;
+
+        public static UI_ComBox_3 Create(GObject gObject = null)
+        {
+            var ui = new UI_ComBox_3();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_ComBox_3 Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ComBox_3();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_loaBg = (GLoader)comp.GetChild("loaBg");
+            m_loaImg = (GLoader)comp.GetChild("loaImg");
+            m_btnPreview = (UI_Button3)UI_Button3.Create(comp.GetChild("btnPreview"));
+            m_btnExchange = (UI_Button3)UI_Button3.Create(comp.GetChild("btnExchange"));
+            m_txtOwned = (GTextField)comp.GetChild("txtOwned");
+            m_comCostOne = (UI_ComCost)UI_ComCost.Create(comp.GetChild("comCostOne"));
+            m_comCostTen = (UI_ComCost)UI_ComCost.Create(comp.GetChild("comCostTen"));
+            m_btnBuyOne = (UI_Button1)UI_Button1.Create(comp.GetChild("btnBuyOne"));
+            m_btnBuyTen = (UI_Button2)UI_Button2.Create(comp.GetChild("btnBuyTen"));
+            m_txtRemainTimes = (GTextField)comp.GetChild("txtRemainTimes");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_loaBg = null;
+            m_loaImg = null;
+            m_btnPreview.Dispose();
+            m_btnPreview = null;
+            m_btnExchange.Dispose();
+            m_btnExchange = null;
+            m_txtOwned = null;
+            m_comCostOne.Dispose();
+            m_comCostOne = null;
+            m_comCostTen.Dispose();
+            m_comCostTen = null;
+            m_btnBuyOne.Dispose();
+            m_btnBuyOne = null;
+            m_btnBuyTen.Dispose();
+            m_btnBuyTen = null;
+            m_txtRemainTimes = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_ComBox_3.cs.meta

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

+ 1 - 40
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_LuckyBoxUI.cs

@@ -7,25 +7,14 @@ namespace UI.LuckyBox
     public partial class UI_LuckyBoxUI
     {
         public GComponent target;
-        public Controller m_c1;
         public GList m_listBg;
         public GButton m_btnBack;
         public GButton m_btnHome;
         public GComponent m_valueBar;
-        public UI_Button3 m_btnPreview;
-        public UI_Button3 m_btnExchange;
-        public GTextField m_txtOwned;
         public GGroup m_grpTop;
-        public UI_ComCost m_comCostOne;
-        public UI_ComCost m_comCostTen;
-        public UI_Button1 m_btnBuyOne;
-        public UI_Button2 m_btnBuyTen;
-        public GImage m_imgSpecial;
-        public GTextField m_txtRemainTimes;
-        public GGroup m_grpBottom;
         public GButton m_btnLeft;
         public GButton m_btnRight;
-        public const string URL = "ui://drx9d1usfka79";
+        public const string URL = "ui://drx9d1uswono2q";
         public const string PACKAGE_NAME = "LuckyBox";
         public const string RES_NAME = "LuckyBoxUI";
         private static UI_LuckyBoxUI _proxy;
@@ -72,49 +61,21 @@ namespace UI.LuckyBox
 
         private void Init(GComponent comp)
         {
-            m_c1 = comp.GetController("c1");
             m_listBg = (GList)comp.GetChild("listBg");
             m_btnBack = (GButton)comp.GetChild("btnBack");
             m_btnHome = (GButton)comp.GetChild("btnHome");
             m_valueBar = (GComponent)comp.GetChild("valueBar");
-            m_btnPreview = (UI_Button3)UI_Button3.Create(comp.GetChild("btnPreview"));
-            m_btnExchange = (UI_Button3)UI_Button3.Create(comp.GetChild("btnExchange"));
-            m_txtOwned = (GTextField)comp.GetChild("txtOwned");
             m_grpTop = (GGroup)comp.GetChild("grpTop");
-            m_comCostOne = (UI_ComCost)UI_ComCost.Create(comp.GetChild("comCostOne"));
-            m_comCostTen = (UI_ComCost)UI_ComCost.Create(comp.GetChild("comCostTen"));
-            m_btnBuyOne = (UI_Button1)UI_Button1.Create(comp.GetChild("btnBuyOne"));
-            m_btnBuyTen = (UI_Button2)UI_Button2.Create(comp.GetChild("btnBuyTen"));
-            m_imgSpecial = (GImage)comp.GetChild("imgSpecial");
-            m_txtRemainTimes = (GTextField)comp.GetChild("txtRemainTimes");
-            m_grpBottom = (GGroup)comp.GetChild("grpBottom");
             m_btnLeft = (GButton)comp.GetChild("btnLeft");
             m_btnRight = (GButton)comp.GetChild("btnRight");
         }
         public void Dispose(bool disposeTarget = false)
         {
-            m_c1 = null;
             m_listBg = null;
             m_btnBack = null;
             m_btnHome = null;
             m_valueBar = null;
-            m_btnPreview.Dispose();
-            m_btnPreview = null;
-            m_btnExchange.Dispose();
-            m_btnExchange = null;
-            m_txtOwned = null;
             m_grpTop = null;
-            m_comCostOne.Dispose();
-            m_comCostOne = null;
-            m_comCostTen.Dispose();
-            m_comCostTen = null;
-            m_btnBuyOne.Dispose();
-            m_btnBuyOne = null;
-            m_btnBuyTen.Dispose();
-            m_btnBuyTen = null;
-            m_imgSpecial = null;
-            m_txtRemainTimes = null;
-            m_grpBottom = null;
             m_btnLeft = null;
             m_btnRight = null;
             if(disposeTarget && target != null)

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

@@ -137,7 +137,6 @@ namespace GFGGame
             _valueBar.m_btnCJ.text = "" + ItemDataManager.GetItemNum(luckyBoxCfg.costID);
             _valueBar.m_btnCJ.icon = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(luckyBoxCfg.costID).res);
 
-
         }
 
         private void UpdateTravel()

+ 4 - 3
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxPreShowView.cs

@@ -32,11 +32,12 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            string probShow = LuckyBoxDataManager.Instance.probShow;
-            probShow = probShow.Replace("\\n", "\n");
+            int boxId = (int)this.viewData;
+            LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
+            string probShow = cfg.probShow.Replace("\\n", "\n");
             _ui.m_compText.m_txtShow.text = probShow;
 
-            _bonusList = LuckyBoxDataManager.Instance.GetCurrentShowList();
+            _bonusList = LuckyBoxDataManager.Instance.GetCurrentShowList(boxId);
             _ui.m_list.RemoveChildrenToPool();
             _ui.m_list.itemRenderer = ListItemRenderer;
             _ui.m_list.numItems = _bonusList.Count;

+ 153 - 118
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

@@ -23,7 +23,9 @@ namespace GFGGame
         private GoWrapper _wrapper3;
 
         private bool isActiveBoxOpen = false;
-        private int bgIndex = 0;
+        private int _bgIndex = 0;
+        private int _boxId = 0;
+        private int _curIndex = 0;
 
         public override void Dispose()
         {
@@ -57,24 +59,22 @@ namespace GFGGame
             _valueBarController = new ValueBarController(_ui.m_valueBar);
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
             _ui.m_btnHome.onClick.Add(OnClickBtnHome);
-            _ui.m_btnBuyOne.target.onClick.Add(OnClickBtnBuyOne);
-            _ui.m_btnBuyTen.target.onClick.Add(OnClickBtnBuyTen);
-            _ui.m_btnPreview.target.onClick.Add(OnClickBtnPreview);
-            _ui.m_btnExchange.target.onClick.Add(OnClickBtnExChange);
-            _ui.m_btnLeft.onClick.Add(() => { onClickChange(-1); });
-            _ui.m_btnRight.onClick.Add(() => { onClickChange(1); });
 
+            _ui.m_btnLeft.onClick.Add(OnBtnLeftClick);
+            _ui.m_btnRight.onClick.Add(OnBtnRightClick);
+
+            _ui.m_listBg.SetVirtual();
             _ui.m_listBg.itemRenderer = RenderListBgItem;
-            _ui.m_c1.onChanged.Add(OnListBgScroll);//分页控制器
+            _ui.m_listBg.itemProvider = GetListItemResource;
+            _ui.m_listBg.scrollPane.onScrollEnd.Add(OnListBgScroll);
 
-            // Reset();//初始默认值
         }
         protected override void AddEventListener()
         {
             base.AddEventListener();
 
-            EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdateNormal);
-            EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateNormal);
+            EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, OnListBgScroll);
+            EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, OnListBgScroll);
         }
         protected override void OnShown()
         {
@@ -94,15 +94,10 @@ namespace GFGGame
                     boxId = (int)this.viewData;
                 }
             }
+            _boxId = boxId;
+            LuckyBoxDataManager.Instance.currentBoxId = _boxId;
 
-            LuckyBoxDataManager.Instance.currentBoxId = boxId;
             isActiveBoxOpen = Array.IndexOf(LuckyBoxDataManager.Instance.luckyBoxIds, LuckyBoxDataManager.BOX_ID_1) >= 0;
-            bgIndex = 0;
-
-            int index = Array.IndexOf(LuckyBoxDataManager.Instance.luckyBoxIds, LuckyBoxDataManager.Instance.currentBoxId);
-            _ui.m_listBg.numItems = LuckyBoxDataManager.Instance.luckyBoxIds.Length;
-            _ui.m_listBg.ScrollToView(index);
-            _ui.m_listBg.scrollPane.decelerationRate = 0.8f;
             if (isActiveBoxOpen)
             {
                 Timers.inst.Add(1, 0, CheckTime);
@@ -111,186 +106,224 @@ namespace GFGGame
             _valueBarController.OnShown();
             _valueBarController.Controller(4);
 
+            _curIndex = Array.IndexOf(LuckyBoxDataManager.Instance.luckyBoxIds, boxId);
+            _ui.m_listBg.numItems = LuckyBoxDataManager.Instance.luckyBoxIds.Length;
+            _ui.m_listBg.ScrollToView(_curIndex);
+            _ui.m_listBg.scrollPane.decelerationRate = 0.8f;
 
-            // onClickChange(0);
-            // UpdateNormal();
             OnListBgScroll();
             updateBoxEffect();
             Timers.inst.Add(8, 0, UpdateBg);
             Timers.inst.AddUpdate(CheckGuide);
         }
-
-        private void RenderListBgItem(int index, GObject obj)
+        private string GetListItemResource(int index)
         {
-            UI_ComListBgItem item = UI_ComListBgItem.Proxy(obj);
-            int id = LuckyBoxDataManager.Instance.luckyBoxIds[index];
-            LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(id);
-
-            item.m_loaBg.url = ResPathUtil.GetBgImgPath(cfg.resArr[0]);
-            item.target.data = id;
-            UI_ComListBgItem.ProxyEnd();
+            int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[index];
+            return string.Format("UI://LuckyBox/ComBox_{0}", boxId);
         }
-        private void CheckTime(object param = null)
+        private void RenderListBgItem(int index, GObject obj)
         {
-            if (!isActiveBoxOpen)
+            int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[index];
+            LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
+            LuckyBoxDataManager.Instance.InitData(boxId);
+            GLoader loaBg = (obj as GComponent).GetChild("loaBg").asLoader;
+            loaBg.url = ResPathUtil.GetBgImgPath(cfg.resArr[0]);
+            GButton btnPreview = (obj as GComponent).GetChild("btnPreview").asButton;
+            btnPreview.GetController("c1").selectedIndex = boxId;
+            GButton btnExchange = (obj as GComponent).GetChild("btnExchange").asButton;
+            btnExchange.GetController("c1").selectedIndex = boxId;
+            GTextField txtOwned = (obj as GComponent).GetChild("txtOwned").asTextField;
+            int count = LuckyBoxDataManager.Instance.GetOwnedCount(boxId);
+            txtOwned.SetVar("v1", "" + count).FlushVars();
+            GTextField txtRemainTimes = (obj as GComponent).GetChild("txtRemainTimes").asTextField;
+            int boughtCount = GameGlobal.myNumericComponent.GetAsInt(cfg.numericType);
+            txtRemainTimes.text = string.Format("今日剩余次数:{0}", cfg.maxCount - boughtCount);
+
+            GTextField txtCost = (obj as GComponent).GetChild("comCostOne").asCom.GetChild("txtCost").asTextField;
+            txtCost.text = cfg.costNum.ToString();
+            GLoader loaCost = (obj as GComponent).GetChild("comCostOne").asCom.GetChild("loaCost").asLoader;
+            loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(cfg.costID).res);
+            GTextField txtCostTen = (obj as GComponent).GetChild("comCostTen").asCom.GetChild("txtCost").asTextField;
+            txtCostTen.text = cfg.costNum.ToString();
+            GLoader loaCostTen = (obj as GComponent).GetChild("comCostTen").asCom.GetChild("loaCost").asLoader;
+            loaCostTen.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(cfg.costID).res);
+
+            GButton btnBuyOne = (obj as GComponent).GetChild("btnBuyOne").asButton;
+            if (btnBuyOne.data == null)
             {
-                //活动未开启                           
-                LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[0];
-
-                Timers.inst.Remove(CheckTime);
-                return;
+                btnBuyOne.onClick.Add(OnClickBtnBuyOne);
             }
-            int endTime = LuckyBoxDataManager.Instance.endTime;
-            int curTime = TimeHelper.ServerNowSecs;
-            TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
-            UI_ComListBgItem.Proxy(_ui.m_listBg.GetChildAt(0)).m_txtTime.text = string.Format("{0}", num);
-            UI_ComListBgItem.Proxy(_ui.m_listBg.GetChildAt(0)).m_txtTimeStr.text = string.Format("{0}", str);
-            UI_ComListBgItem.ProxyEnd();
-        }
-        private void OnListBgScroll()
-        {
-            UI_ComListBgItem item = UI_ComListBgItem.Proxy(_ui.m_listBg.GetChildAt(_ui.m_c1.selectedIndex));
-            LuckyBoxDataManager.Instance.currentBoxId = (int)item.target.data;// LuckyBoxDataManager.Instance.luckyBoxIds[_ui.m_c1.selectedIndex];
+            btnBuyOne.data = boxId;
 
-            item.m_grpTime.visible = LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
-            item.m_imgTitle.visible = LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
-            item.m_holder.visible = isActiveBoxOpen && LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
-            item.m_holder1.visible = isActiveBoxOpen && LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
-            item.m_loaImg.visible = LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_3;
+            GButton btnBuyTen = (obj as GComponent).GetChild("btnBuyTen").asButton;
+            if (btnBuyTen.data == null)
+            {
+                btnBuyTen.onClick.Add(OnClickBtnBuyTen);
+            }
+            btnBuyTen.data = boxId;
 
+            if (btnExchange.data == null)
+            {
+                btnExchange.onClick.Add(OnClickBtnExChange);
+            }
+            btnExchange.data = boxId;
+            if (btnPreview.data == null)
+            {
+                btnPreview.onClick.Add(OnClickBtnPreview);
+            }
+            btnPreview.data = boxId;
 
-            onClickChange(0);
-            UpdateNormal();
+            obj.data = boxId;
         }
 
-        private void UpdateNormal()
+        private void UpdateBg(object param)
         {
-            LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.currentBoxId);
-            _valueBarController.UpdateCJ(LuckyBoxDataManager.Instance.currentBoxId);
-
-            _ui.m_comCostOne.m_txtCost.text = luckyBoxCfg.costNum.ToString();
-            _ui.m_comCostTen.m_txtCost.text = luckyBoxCfg.costNumTen.ToString();
-            _ui.m_comCostOne.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(luckyBoxCfg.costID).res);
-            _ui.m_comCostTen.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(luckyBoxCfg.costID).res);
+            string[] resArr = LuckyBoxCfgArray.Instance.GetCfg(_boxId).resArr;
+            _bgIndex++;
+            if (_bgIndex >= resArr.Length) _bgIndex = 0;
+            GLoader loaBg = _ui.m_listBg.GetChildAt(0).asCom.GetChild("loaBg").asLoader;
+            loaBg.url = ResPathUtil.GetBgImgPath(resArr[_bgIndex]);
+        }
 
-            _ui.m_btnPreview.m_c1.selectedIndex = _ui.m_c1.selectedIndex;
-            _ui.m_btnExchange.m_c1.selectedIndex = _ui.m_c1.selectedIndex;
 
-            int count = LuckyBoxDataManager.Instance.GetOwnedCount();
-            _ui.m_txtOwned.SetVar("v1", "" + count).FlushVars();
+        private void OnBtnLeftClick()
+        {
+            _curIndex--;
+            _curIndex = Mathf.Max(0, _curIndex);
+            _ui.m_listBg.ScrollToView(_curIndex, true);
+            OnListBgScroll();
+        }
 
-            int boughtCount = GameGlobal.myNumericComponent.GetAsInt(luckyBoxCfg.numericType);
-            _ui.m_txtRemainTimes.text = string.Format("今日剩余次数:{0}", luckyBoxCfg.maxCount - boughtCount);
+        private void OnBtnRightClick()
+        {
+            _curIndex++;
+            _curIndex = Mathf.Min(_ui.m_listBg.numItems - 1, _curIndex);
+            _ui.m_listBg.ScrollToView(_curIndex, true);
+            OnListBgScroll();
         }
 
-        private void onClickChange(int count)
+        private void OnListBgScroll()
         {
-            _ui.m_c1.selectedIndex = _ui.m_c1.selectedIndex + count;
-            _ui.m_imgSpecial.visible = LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
-            _ui.m_btnRight.visible = _ui.m_c1.selectedIndex != _ui.m_listBg.numItems - 1;
-            _ui.m_btnLeft.visible = _ui.m_c1.selectedIndex != 0;
-            _ui.m_btnBuyOne.m_holder.visible = LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
-            _ui.m_btnBuyTen.m_holder.visible = LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
+            _curIndex = _ui.m_listBg.ChildIndexToItemIndex(0);
+            _boxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
+            _valueBarController.UpdateCJ(_boxId);
+            _bgIndex = 0;
+            LuckyBoxDataManager.Instance.currentBoxId = _boxId;
+
+            _ui.m_btnLeft.grayed = _curIndex <= 0;
+            _ui.m_btnRight.grayed = _curIndex >= _ui.m_listBg.numItems - 1;
+            if (_boxId == LuckyBoxDataManager.BOX_ID_1)
+            {
+                Timers.inst.Add(1, 0, CheckTime);
+            }
+            else
+            {
+                Timers.inst.Remove(CheckTime);
+            }
         }
 
+        private void CheckTime(object param = null)
+        {
+            int endTime = LuckyBoxDataManager.Instance.endTime;
+            int curTime = TimeHelper.ServerNowSecs;
+            TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
+            _ui.m_listBg.GetChildAt(0).asCom.GetChild("txtTime").asTextField.text = string.Format("{0}", num);
+            _ui.m_listBg.GetChildAt(0).asCom.GetChild("txtTimeStr").asTextField.text = string.Format("{0}", str);
+        }
         private void updateBoxEffect()
         {
             if (isActiveBoxOpen)
             {
-                int index = Array.IndexOf(LuckyBoxDataManager.Instance.luckyBoxIds, LuckyBoxDataManager.BOX_ID_1);
-                UI_ComListBgItem item = UI_ComListBgItem.Proxy(_ui.m_listBg.GetChildAt(index));
-                string resPath = ResPathUtil.GetViewEffectPath("ui_cj", "ui_cj_bt");
-                SceneController.AddObjectToView(_gameObject, _wrapper, item.m_holder, resPath, out _gameObject, out _wrapper);
-                string resPath3 = ResPathUtil.GetDressUpAnimationPath("dz_jiyuet");
-                SceneController.AddObjectToView(_gameObject3, _wrapper3, item.m_holder1, resPath3, out _gameObject3, out _wrapper3, 120);
-
-                string resPath1 = ResPathUtil.GetViewEffectPath("ui_cj", "ui_cj_sl");
-                SceneController.AddObjectToView(_gameObject1, _wrapper1, _ui.m_btnBuyOne.m_holder, resPath1, out _gameObject1, out _wrapper1);
-                SceneController.AddObjectToView(_gameObject2, _wrapper2, _ui.m_btnBuyTen.m_holder, resPath1, out _gameObject2, out _wrapper2);
-                UI_ComListBgItem.ProxyEnd();
+                // int index = Array.IndexOf(LuckyBoxDataManager.Instance.luckyBoxIds, LuckyBoxDataManager.BOX_ID_1);
+                // UI_ComListBgItem item = UI_ComListBgItem.Proxy(_ui.m_listBg.GetChildAt(index));
+                // string resPath = ResPathUtil.GetViewEffectPath("ui_cj", "ui_cj_bt");
+                // SceneController.AddObjectToView(_gameObject, _wrapper, item.m_holder, resPath, out _gameObject, out _wrapper);
+                // string resPath3 = ResPathUtil.GetDressUpAnimationPath("dz_jiyuet");
+                // SceneController.AddObjectToView(_gameObject3, _wrapper3, item.m_holder1, resPath3, out _gameObject3, out _wrapper3, 120);
+
+                // string resPath1 = ResPathUtil.GetViewEffectPath("ui_cj", "ui_cj_sl");
+                // SceneController.AddObjectToView(_gameObject1, _wrapper1, _ui.m_btnBuyOne.m_holder, resPath1, out _gameObject1, out _wrapper1);
+                // SceneController.AddObjectToView(_gameObject2, _wrapper2, _ui.m_btnBuyTen.m_holder, resPath1, out _gameObject2, out _wrapper2);
+                // UI_ComListBgItem.ProxyEnd();
 
             }
         }
-        private void OnClickBtnExChange()
+        private void OnClickBtnExChange(EventContext context)
         {
-            int storeId = LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1 ? ConstStoreId.LUCKY_BOX_ACTIVITY_STORE_ID : ConstStoreId.LUCKY_BOX_STORE_ID;
-            ViewManager.Show(ViewName.CLOTHING_SHOP_VIEW, new object[] { storeId }, new object[] { ViewName.LUCKY_BOX_VIEW, LuckyBoxDataManager.Instance.currentBoxId });
+            GObject obj = context.sender as GObject;
+            int boxId = (int)obj.data;
+            int storeId = boxId == LuckyBoxDataManager.BOX_ID_1 ? ConstStoreId.LUCKY_BOX_ACTIVITY_STORE_ID : ConstStoreId.LUCKY_BOX_STORE_ID;
+            ViewManager.Show(ViewName.CLOTHING_SHOP_VIEW, new object[] { storeId }, new object[] { ViewName.LUCKY_BOX_VIEW, boxId });
             this.Hide();
         }
-        private void OnClickBtnPreview()
+        private void OnClickBtnPreview(EventContext context)
         {
-            ViewManager.Show(ViewName.LUCKY_BOX_PRE_SHOW_VIEW);
+            GObject obj = context.sender as GObject;
+            int boxId = (int)obj.data;
+            ViewManager.Show(ViewName.LUCKY_BOX_PRE_SHOW_VIEW, boxId);
         }
-        private void OnClickBtnBuyOne()
+        private void OnClickBtnBuyOne(EventContext context)
         {
-            LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.currentBoxId);
+            GObject obj = context.sender as GObject;
+            int boxId = (int)obj.data;
+            LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
             int boughtCount = GameGlobal.myNumericComponent.GetAsInt(luckyBoxCfg.numericType);
             if (boughtCount + LuckyBoxDataManager.ONCE_TIME > luckyBoxCfg.maxCount)
             {
                 PromptController.Instance.ShowFloatTextPrompt("抽奖次数不足");
                 return;
             }
-            LuckyBoxDataManager.Instance.CheckItemEnough(LuckyBoxDataManager.Instance.currentBoxId, LuckyBoxDataManager.ONCE_TIME, async () =>
+            LuckyBoxDataManager.Instance.CheckItemEnough(boxId, LuckyBoxDataManager.ONCE_TIME, async () =>
              {
-                 bool result = await LuckyBoxSProxy.ReqGetBonus(LuckyBoxDataManager.Instance.currentBoxId, LuckyBoxDataManager.ONCE_TIME);
+                 bool result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.ONCE_TIME);
                  if (result)
                  {
-                     ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, null, new object[] { ViewName.LUCKY_BOX_VIEW, LuckyBoxDataManager.Instance.currentBoxId });
+                     ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, null, new object[] { ViewName.LUCKY_BOX_VIEW, boxId });
                      LogServerHelper.SendNodeLog((int)PlayParticipationEnum.ZAI_XING, 2);
 
                  }
              });
         }
 
-        private void OnClickBtnBuyTen()
+        private void OnClickBtnBuyTen(EventContext context)
         {
-            LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.currentBoxId);
+            GObject obj = context.sender as GObject;
+            int boxId = (int)obj.data;
+            LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
             int boughtCount = GameGlobal.myNumericComponent.GetAsInt(luckyBoxCfg.numericType);
             if (boughtCount + LuckyBoxDataManager.TEN_TIME > luckyBoxCfg.maxCount)
             {
                 PromptController.Instance.ShowFloatTextPrompt("抽奖次数不足");
                 return;
             }
-            LuckyBoxDataManager.Instance.CheckItemEnough(LuckyBoxDataManager.Instance.currentBoxId, LuckyBoxDataManager.TEN_TIME, async () =>
+            LuckyBoxDataManager.Instance.CheckItemEnough(boxId, LuckyBoxDataManager.TEN_TIME, async () =>
             {
-                bool result = await LuckyBoxSProxy.ReqGetBonus(LuckyBoxDataManager.Instance.currentBoxId, LuckyBoxDataManager.TEN_TIME);
+                bool result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.TEN_TIME);
                 if (result)
                 {
 
-                    ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, null, new object[] { ViewName.LUCKY_BOX_VIEW, LuckyBoxDataManager.Instance.currentBoxId });
+                    ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, null, new object[] { ViewName.LUCKY_BOX_VIEW, boxId });
                     LogServerHelper.SendNodeLog((int)PlayParticipationEnum.ZAI_XING, 2);
 
                 }
             });
         }
 
-        private void UpdateBg(object param)
-        {
-            int index = Array.IndexOf(LuckyBoxDataManager.Instance.luckyBoxIds, LuckyBoxDataManager.Instance.currentBoxId);
-            UI_ComListBgItem item = UI_ComListBgItem.Proxy(_ui.m_listBg.GetChildAt(index));
-            int id = (int)item.target.data;
-            string[] resArr = LuckyBoxCfgArray.Instance.GetCfg(id).resArr;
-            bgIndex++;
-            if (bgIndex >= resArr.Length) bgIndex = 0;
-            item.m_loaBg.url = ResPathUtil.GetBgImgPath(resArr[bgIndex]);
-            UI_ComListBgItem.ProxyEnd();
-        }
+
         protected override void OnHide()
         {
             base.OnHide();
             _valueBarController.OnHide();
 
             Timers.inst.Remove(CheckTime);
-
             Timers.inst.Remove(UpdateBg);
-
             Timers.inst.Remove(CheckGuide);
         }
         protected override void RemoveEventListener()
         {
             base.RemoveEventListener();
-            EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, UpdateNormal);
-            EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateNormal);
+            EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, OnListBgScroll);
+            EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, OnListBgScroll);
         }
         private void OnClickBtnBack()
         {
@@ -307,7 +340,7 @@ namespace GFGGame
         }
         private void Reset()
         {
-            LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.BOX_ID_1;
+            LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[0];
 
         }
         private void CheckGuide(object param)
@@ -326,7 +359,9 @@ namespace GFGGame
         protected override void UpdateToCheckGuide(object param)
         {
             if (!ViewManager.CheckIsTopView(this.viewCom)) return;
-            GuideController.TryGuide(_ui.m_btnBuyTen.target, ConstGuideId.LUCKY_BOX, 3, "点击摘取十次。");
+            GButton btnBuyTen = _ui.m_listBg.GetChildAt(0).asCom.GetChild("btnBuyTen").asButton;
+
+            GuideController.TryGuide(btnBuyTen, ConstGuideId.LUCKY_BOX, 3, "点击摘取十次。");
 
             GuideController.TryGuide(_ui.m_btnBack, ConstGuideId.FREEDOM_DRESS, 1, "获得一套完整的服装啦,马上去试穿一下。");
         }

BIN
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_atlas0.png


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