Răsfoiți Sursa

飘字改成显示三条

huangxiaoyue 1 an în urmă
părinte
comite
b1aebca52a

+ 9 - 2
GameClient/Assets/Game/HotUpdate/Controller/PromptController.cs

@@ -8,8 +8,8 @@ namespace GFGGame
 {
     public class PromptController : SingletonBase<PromptController>
     {
-
         private List<GComponent> _uis = new List<GComponent>();
+        private int showCount = 3;  //ÏÔʾ¶àÉÙÌõ
 
         public PromptController()
         {
@@ -69,7 +69,14 @@ namespace GFGGame
                 GComponent preui = _uis[_uis.Count - 1];
                 ui.x = preui.x;
                 ui.y = preui.y + 100;
+                if (_uis.Count >= showCount) {
+                    GComponent uiFirst = _uis[0];
+                    _uis.Remove(uiFirst);
+                    uiFirst.RemoveFromParent();
+                    uiFirst.Dispose();
+                }
             }
+
             ui.data = ET.TimeHelper.ClientNow() + 3000;
             _uis.Add(ui);
         }
@@ -78,7 +85,7 @@ namespace GFGGame
         {
             foreach (GComponent ui in _uis)
             {
-                ui.y -= 50;
+                ui.y -= 100;
             }
         }
     }