using UnityEngine; using UnityEngine.UI; using System.Collections; public class ProgressPanel : PopUpPanel { // Use 哈 this for initialization public Text uiText; private string text; private int count; private float lastUpdateTime; public void SetText(string text) { if (text != null) this.text = uiText.text = text; else this.text = uiText.text = ""; count = 0; } // Use this for initialization void FixedUpdate () { float currentTime = GameTime.time; if(Mathf.Floor(currentTime) != Mathf.Floor(lastUpdateTime)) { int i = 0; int total = count%6; count++; string t = this.text; while(i < total) { t += "."; i++; } uiText.text = t; lastUpdateTime = currentTime; } } public static void Show(string text=null) { ProgressPanel panelProgress = null; ProgressPanel[] panelProgressArr = GameObject.FindObjectsOfType(); if(panelProgressArr.Length == 0) { panelProgress = (ProgressPanel)PopUpManager.AddPopUp(Resources.Load("Prefabs/UI/ProgressPanel"), null, true); } else { panelProgress = panelProgressArr[0]; for(int i=1; i(); for(int i=0; i