static public void DrawGui() { float fx = (Screen.width - 400) * 0.5f; float fy = (Screen.height - 95); float fProg = GameResMng.GetProgress(); int bytesPersecond = GameResMng.GetResMng().GetDownloadBytesPerSecond(); float kbPerSecond = bytesPersecond / 1024.0f; GUIStyle st = new GUIStyle(); st.fontSize = 24; st.normal.textColor = UnityEngine.Color.black; if (GameResMng.GetResMng().m_failedDownloadPackage.Count != 0 && GameResMng.GetResMng().IsDownloadQueueEmpty) { } else { string msg = string.Format("資源包下載中 --- {0:###.##}% {1:.##}KB/S", fProg, kbPerSecond); GUI.Label(new Rect(fx, fy, 400, 95), msg, st); } }
void OnGUI() { //GUI.Slider(); GameResMng.OnResMngGUI(); if (null != mLvCtrl) { mLvCtrl.mRctWH.x = Screen.width; mLvCtrl.mViewWH.x = Screen.width; float py = Screen.height - mLvCtrl.mRctWH.y; mLvCtrl.OnDrawListView(0, py); } if (!GameResMng.IsLoaded()) { float fx = (Screen.width - 300) * 0.5f; float fy = (Screen.height - 60); float fw = Screen.width * 0.8f; fx = (Screen.width - fw) * 0.5f; float fProg = GameResMng.GetProgress(); GUI.Label(new Rect(fx, fy, 300, 80), @"进度: " + fProg + "%"); //GUI.HorizontalScrollbar (new Rect (fx, fy, fw, 30), fProg, 1.0f, 0.0f, 100.0f); } }