| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 | 
							- using System.Collections.Generic;
 
- using UI.Common;
 
- using UnityEngine;
 
- using FairyGUI;
 
- using System;
 
- namespace GFGGame
 
- {
 
-     public class PromptController : SingletonBase<PromptController>
 
-     {
 
-         private List<GComponent> _uis = new List<GComponent>();
 
-         private int showCount = 3;  //显示多少条
 
-         public PromptController()
 
-         {
 
-             Timers.inst.AddUpdate(Update);
 
-         }
 
-         private void Update(object param)
 
-         {
 
-             if (_uis.Count > 0)
 
-             {
 
-                 GComponent ui = _uis[0];
 
-                 long endTime = (long)ui.data;
 
-                 if (endTime < ET.TimeHelper.ClientNow())
 
-                 {
 
-                     _uis.Remove(ui);
 
-                     GTweener gTweener = ui.TweenFade(0, 0.5f);
 
-                     gTweener.OnComplete(() =>
 
-                     {
 
-                         ui.RemoveFromParent();
 
-                         ui.Dispose();
 
-                     });
 
-                 }
 
-             }
 
-         }
 
-         public void ShowFloatTextPrompt(string message, MessageType messageType = MessageType.ERR)
 
-         {
 
-             GComponent ui;
 
-             // switch(messageType)
 
-             // {
 
-             //     case MessageType.WARNING:
 
-             //         ui = UI_FloatingTextPromptWarningUI.Proxy().target;
 
-             //         break;
 
-             //     case MessageType.NORMAL:
 
-             //         ui = UI_FloatingTextPromptNarmalUI.Proxy().target;
 
-             //         break;
 
-             //     case MessageType.SUCCESS:
 
-             //         ui = UI_FloatingTextPromptSuccessUI.Proxy().target;
 
-             //         break;
 
-             //     default:
 
-             //         ui = UI_FloatingTextPromptErrUI.Proxy().target;
 
-             //         break;
 
-             // }
 
-             ui = UI_FloatingTextPromptNarmalUI.Proxy().target;
 
-             ViewManager.AddChildToFloatLayer(ui);
 
-             GTextField textField = ui.GetChild("txtMessage") as GTextField;
 
-             textField.text = message;
 
-             if (_uis.Count <= 0)
 
-             {
 
-                 ui.Center();
 
-             }
 
-             else
 
-             {
 
-                 MoveAllUp();
 
-                 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);
 
-         }
 
-         private void MoveAllUp()
 
-         {
 
-             foreach (GComponent ui in _uis)
 
-             {
 
-                 ui.y -= 100;
 
-             }
 
-         }
 
-     }
 
- }
 
 
  |