Bläddra i källkod

调整限时礼包效果

何晓捷 2 år sedan
förälder
incheckning
b91945deac

+ 7 - 6
FGUIProject/assets/EnduringGiftBox/RushSaleGiftBoxUI.xml

@@ -42,13 +42,14 @@
     <item time="0" type="Alpha" target="n4_yjmk" value="0"/>
     <item time="0" type="Alpha" target="n5_yjmk" value="0"/>
     <item time="0" type="Alpha" target="n6_yjmk" value="0"/>
-    <item time="0" type="Alpha" target="n6_yjmk" value="1"/>
-    <item time="0" type="Alpha" target="n8_yjmk" value="1"/>
+    <item time="0" type="Alpha" target="n6_yjmk" value="0"/>
+    <item time="0" type="Alpha" target="n8_yjmk" value="0"/>
     <item time="0" type="Alpha" target="n8_yjmk" value="0"/>
     <item time="0" type="Scale" target="n24_droi" tween="true" startValue="0.95,0.95" endValue="1,1" duration="12" ease="Linear"/>
     <item time="0" type="Visible" target="n24_droi" value="false"/>
     <item time="0" type="Visible" target="n27_droi" value="false"/>
     <item time="0" type="XY" target="n19_droi" tween="true" startValue="70,380" endValue="63,380" duration="10" ease="Linear"/>
+    <item time="0" type="XY" target="n20_droi" tween="true" startValue="863,386" endValue="877,386" duration="12" ease="Linear"/>
     <item time="0" type="XY" target="n24_droi" tween="true" startValue="274,290" endValue="263,282" duration="12" ease="Linear"/>
     <item time="0" type="XY" target="n2_yjmk" tween="true" startValue="335,20" endValue="335,26" duration="11" ease="Linear"/>
     <item time="6" type="Visible" target="n24_droi" value="true"/>
@@ -57,12 +58,12 @@
     <item time="15" type="Alpha" target="n12_yjmk" tween="true" startValue="0.2" endValue="1" duration="19" ease="Linear"/>
     <item time="15" type="Alpha" target="n13_yjmk" tween="true" startValue="0.2" endValue="1" duration="19" ease="Linear"/>
     <item time="15" type="Alpha" target="n14_yjmk" tween="true" startValue="0.2" endValue="1" duration="19" ease="Linear"/>
+    <item time="15" type="Alpha" target="n15_yjmk" tween="true" startValue="0.2" endValue="1" duration="16" ease="Linear"/>
     <item time="15" type="Alpha" target="n16_yjmk" tween="true" startValue="0.2" endValue="1" duration="19" ease="Linear"/>
     <item time="15" type="Alpha" target="n24_droi" tween="true" startValue="0" endValue="1" duration="19" ease="Linear"/>
     <item time="15" type="Alpha" target="n4_yjmk" tween="true" startValue="0.2" endValue="1" duration="19" ease="Linear"/>
-    <item time="15" type="Alpha" target="n5_yjmk" tween="true" startValue="0.2" endValue="1" duration="19" ease="Linear"/>
-    <item time="15" type="Alpha" target="n6_yjmk" tween="true" startValue="0.2" endValue="1" duration="19" ease="Quint.Out"/>
-    <item time="15" type="Alpha" target="n8_yjmk" tween="true" startValue="0.2" endValue="1" duration="19" ease="Linear"/>
-    <item time="18" type="Alpha" target="n15_yjmk" tween="true" startValue="0.2" endValue="1" duration="16" ease="Linear"/>
+    <item time="15" type="Alpha" target="n5_yjmk" tween="true" startValue="0.2" endValue="1" duration="19" ease="Quart.Out"/>
+    <item time="15" type="Alpha" target="n6_yjmk" tween="true" startValue="0" endValue="1" duration="14" ease="Quint.Out"/>
+    <item time="15" type="Alpha" target="n8_yjmk" tween="true" startValue="0.2" endValue="1" duration="19" ease="Quint.Out"/>
   </transition>
 </component>

+ 5 - 1
FGUIProject/assets/EnduringGiftBox/components/ComRsGifBoxIconItem.xml

@@ -3,6 +3,10 @@
   <displayList>
     <component id="n3_yjmk" name="comRewardIconItem" src="qqhz1g" fileName="components/ComRewardIconItem.xml" xy="3,2" size="132,132" aspect="true" scale="1.09,1.09"/>
     <text id="n1_yjmk" name="txtItemName" xy="6,138" size="143,56" fontSize="39" color="#a47e49" align="center" autoSize="none" text="体力"/>
-    <graph id="n4_droi" name="holderItem" xy="79,70" size="46,42"/>
+    <graph id="n4_droi" name="holderItem" xy="77,71" size="46,42"/>
   </displayList>
+  <transition name="t1">
+    <item time="0" type="Visible" target="n4_droi" value="false"/>
+    <item time="12" type="Visible" target="n4_droi" value="true"/>
+  </transition>
 </component>

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComRsGifBoxIconItem.cs

@@ -10,6 +10,7 @@ namespace UI.EnduringGiftBox
         public UI_ComRewardIconItem m_comRewardIconItem;
         public GTextField m_txtItemName;
         public GGraph m_holderItem;
+        public Transition m_t1;
         public const string URL = "ui://bdi1qe15yjmk2p";
         public const string PACKAGE_NAME = "EnduringGiftBox";
         public const string RES_NAME = "ComRsGifBoxIconItem";
@@ -60,6 +61,7 @@ namespace UI.EnduringGiftBox
             m_comRewardIconItem = (UI_ComRewardIconItem)UI_ComRewardIconItem.Create(comp.GetChild("comRewardIconItem"));
             m_txtItemName = (GTextField)comp.GetChild("txtItemName");
             m_holderItem = (GGraph)comp.GetChild("holderItem");
+            m_t1 = comp.GetTransition("t1");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -67,6 +69,7 @@ namespace UI.EnduringGiftBox
             m_comRewardIconItem = null;
             m_txtItemName = null;
             m_holderItem = null;
+            m_t1 = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 55 - 12
GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/RushSaleGiftBoxView.cs

@@ -19,21 +19,22 @@ namespace GFGGame
         private int _type; //决定数据的类型 --等级条件的数据,时间条件的数据
 
         private int _pageIndex; //当前页码,需要显示的数据的索引
-        
-        private List<GameObject>  _gameObjectList;
+
+        private List<GGraph> _graphList = new List<GGraph>();
+        private List<GameObject> _gameObjectList = new List<GameObject>();
         private GameObject _gameObject1;
         private GameObject _gameObject2;
         private GameObject _gameObject3;
         private GameObject _gameObject4;
         private GameObject _gameObject5;
 
-        private List<GoWrapper> _wrapperList;
+        private List<GoWrapper> _wrapperList = new List<GoWrapper>();
         private GoWrapper _wrapper1;
         private GoWrapper _wrapper2;
         private GoWrapper _wrapper3;
         private GoWrapper _wrapper4;
         private GoWrapper _wrapper5;
-        
+
         protected override void OnInit()
         {
             base.OnInit();
@@ -50,7 +51,7 @@ namespace GFGGame
             _ui.m_btnBack.onClick.Add(OnBtnCancelClick);
             _ui.m_btnBuyPink.target.onClick.Add(OnBtnBuyClick);
         }
-        
+
         protected override void OnShown()
         {
             base.OnShown();
@@ -84,15 +85,22 @@ namespace GFGGame
             string resPath1 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_pepole");
             SceneController.AddObjectToView(null, null, _ui.m_holderPaoBaby, resPath1,
                 out _gameObject1, out _wrapper1);
-            string resPath2 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_button");
-            SceneController.AddObjectToView(null, null, _ui.m_holderBtnBy, resPath2,
-                out _gameObject2, out _wrapper2);
+
             string resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_discount_chixu");
             SceneController.AddObjectToView(null, null, _ui.m_holderZheKouChiXu, resPath3,
                 out _gameObject3, out _wrapper3);
-            string resPath4 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_discount_baofa");
-            SceneController.AddObjectToView(null, null, _ui.m_holderZheKou, resPath4,
-                out _gameObject4, out _wrapper4);
+
+            Timers.inst.Add(0.8f, 1, (obj) =>
+                {
+                    string resPath4 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_discount_baofa");
+                    SceneController.AddObjectToView(null, null, _ui.m_holderZheKou, resPath4,
+                        out _gameObject4, out _wrapper4);
+
+                    string resPath2 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_button");
+                    SceneController.AddObjectToView(null, null, _ui.m_holderBtnBy, resPath2,
+                        out _gameObject2, out _wrapper2);
+                }
+            );
             string resPath5 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_star");
             SceneController.AddObjectToView(null, null, _ui.m_holderStar, resPath5,
                 out _gameObject5, out _wrapper5);
@@ -263,6 +271,16 @@ namespace GFGGame
             uiItem.m_comRewardIconItem.m_num.text = itemKv[1].ToString();
             uiItem.m_comRewardIconItem.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
             uiItem.m_comRewardIconItem.target.onClick.Add(OnListSelectorItemClick);
+
+            if (!_graphList.Contains(uiItem.m_holderItem))
+            {
+                string resPath = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_kuang");
+                SceneController.AddObjectToView(null, null, uiItem.m_holderItem, resPath, out var gameObject,
+                    out var wrapper);
+                _graphList.Add(uiItem.m_holderItem);
+                _gameObjectList.Add(gameObject);
+                _wrapperList.Add(wrapper);
+            }
         }
 
         private void UpViewNone()
@@ -314,6 +332,30 @@ namespace GFGGame
             }
         }
 
+        private void DestroyObjectFromView()
+        {
+            foreach (var itemGameObject in _gameObjectList)
+            {
+                if (itemGameObject != null)
+                {
+                    GameObject.DestroyImmediate(itemGameObject);
+                }
+            }
+            
+            _gameObjectList.Clear();
+
+            foreach (var itemWrapper in _wrapperList)
+            {
+                if (itemWrapper != null)
+                {
+                    itemWrapper.Dispose();
+                }
+            }
+
+            _wrapperList.Clear();
+            _graphList.Clear();
+        }
+
         protected override void OnHide()
         {
             SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
@@ -321,6 +363,7 @@ namespace GFGGame
             SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
             SceneController.DestroyObjectFromView(_gameObject4, _wrapper4);
             SceneController.DestroyObjectFromView(_gameObject5, _wrapper5);
+            DestroyObjectFromView();
             this.RemoveEventListener();
             //Dispose();
             base.Hide();
@@ -330,7 +373,7 @@ namespace GFGGame
         {
             this.Hide();
         }
-        
+
         //弹出物品详细描述框
         private void OnListSelectorItemClick(EventContext context)
         {

BIN
GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_fui.bytes