| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 | 
							- 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>();
 
-         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 < ServerDataManager.currentTimeMillis)
 
-                 {
 
-                     _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;
 
-             }
 
-             ViewManager.AddChildToTopLayer(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 + 50;
 
-             }
 
-             ui.data = ServerDataManager.currentTimeMillis + 3000;
 
-             _uis.Add(ui);
 
-         }
 
-         private void MoveAllUp()
 
-         {
 
-             foreach (GComponent ui in _uis)
 
-             {
 
-                 ui.y -= 50;
 
-             }
 
-         }
 
-     }
 
- }
 
 
  |