huangxiaoyue 2 жил өмнө
parent
commit
52eef9bfdc

+ 6 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_RewardUI.cs

@@ -7,8 +7,10 @@ namespace UI.CommonGame
     public partial class UI_RewardUI
     {
         public GComponent target;
+        public GGraph m_bg;
         public GGraph m_holderTitle;
         public GList m_listReward;
+        public GGroup m_downTipsText;
         public GGroup m_grp;
         public const string URL = "ui://eg2y0ldpm9wm8q";
         public const string PACKAGE_NAME = "CommonGame";
@@ -57,14 +59,18 @@ namespace UI.CommonGame
 
         private void Init(GComponent comp)
         {
+            m_bg = (GGraph)comp.GetChild("bg");
             m_holderTitle = (GGraph)comp.GetChild("holderTitle");
             m_listReward = (GList)comp.GetChild("listReward");
+            m_downTipsText = (GGroup)comp.GetChild("downTipsText");
             m_grp = (GGroup)comp.GetChild("grp");
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_bg = null;
             m_holderTitle = null;
             m_listReward = null;
+            m_downTipsText = null;
             m_grp = null;
             if(disposeTarget && target != null)
             {

+ 31 - 17
GameClient/Assets/Game/HotUpdate/Views/CommonGame/RewardView.cs

@@ -19,6 +19,7 @@ namespace GFGGame
         private const int maxHeight = 1030;
 
         private EffectUI _effectUI1;
+        private int counTime = 0;  //定时器计数
 
         public override void Dispose()
         {
@@ -36,13 +37,13 @@ namespace GFGGame
             base.OnInit();
             _ui = UI_RewardUI.Create();
             this.viewCom = _ui.target;
-            this.viewCom.Center();
-            this.modal = true;
+            //this.viewCom.Center();
+            //this.modal = true;
             //viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
+            isfullScreen = true;
 
             _ui.m_listReward.itemRenderer = RenderListRewardItem;
-
-            this.viewCom.onClick.Add(this.Hide);
+            _ui.m_bg.onClick.Add(this.Hide);
         }
         protected override void OnShown()
         {
@@ -71,27 +72,38 @@ namespace GFGGame
                 }
             }
             _listItemDatas.AddRange(suitPart);
+            //_ui.m_listReward.SetVirtual();  //有虚拟列表的时候,没有办法居中显示列表
 
-            //_ui.m_listReward.SetVirtual();
-            _ui.m_listReward.numItems = _listItemDatas.Count;
-
-            _ui.m_listReward.ResizeToFit();
-            if (_ui.m_listReward.height > maxHeight)
-            {
-                _ui.m_listReward.height = maxHeight;
-            }
-
-            Timers.inst.Add(1f, 1, OnTimerUpdate, 1);
+            _ui.m_downTipsText.visible = false;
+            _ui.m_listReward.numItems = 0;
+            counTime = 0;
+            Timers.inst.Add(0.1f, 3, OnTimerUpdate, 1);
             //邊框左上角特效
             //_effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holderTitle, "ui_hd", "GXHD");
         }
 
         private void OnTimerUpdate(object param)
         {
+            counTime += 1;
+            if (counTime == 1)
+            {
+                _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holderTitle, "ui_hd", "GXHD");
+            }
+            else if (counTime == 2)
+            {
+                _ui.m_listReward.numItems = _listItemDatas.Count;
 
-            Timers.inst.Remove(OnTimerUpdate);
-            _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holderTitle, "ui_hd", "GXHD");
-
+                _ui.m_listReward.ResizeToFit();
+                if (_ui.m_listReward.height > maxHeight)
+                {
+                    _ui.m_listReward.height = maxHeight;
+                }
+            }
+            else if (counTime == 3)
+            {
+                _ui.m_downTipsText.visible = true;
+                Timers.inst.Remove(OnTimerUpdate);
+            }
         }
 
         protected override void OnHide()
@@ -99,6 +111,8 @@ namespace GFGGame
             EffectUIPool.Recycle(_effectUI1);
             _effectUI1 = null;
 
+            Timers.inst.Remove(OnTimerUpdate);
+
             for (int i = 0; i < _effects.Count; i++)
             {
                 if (_effects[i] != null)

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterListView.cs

@@ -69,6 +69,7 @@ namespace GFGGame
             base.OnHide();
 
             Timers.inst.Remove(CheckGuide);
+            Timers.inst.Remove(OnTimerUpdate);
         }
 
         private void OnClickBtnBack()

BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes