//using UnityEngine;
//using System.Collections;

//public class LoadingStatusGUI : MonoBehaviour 
//{
//    private const float _totalBytes = 20661774.0f;
//    public Texture2D barTexture;
//    public bool showSceneStatus;
//    public string statusScene;
//    public bool showOverallStatus = true;

//    public GUISkin skin;

//    void OnGUI()
//    {
//        #if PROFILE
//        var profiler = SmilingProfiler.GetProfiler("LoadingStatusGUI.OnGUI");
//        profiler.StartTiming();
//        #endif

//        float scaleFactor = Screen.height * 0.001f;
//        GUI.matrix = Matrix4x4.TRS (new Vector3(Screen.width * 0.5f, Screen.height * 0.5f, 0.0f), Quaternion.identity, new Vector3 (scaleFactor, scaleFactor, 1.0f)); 

//        if(skin)
//        {
//            GUI.skin = skin;
//        }
//        else
//        {
//            Debug.Log("GUI skin object missing.");
//        }

//        GUI.depth = -10;

//        int bytesLoaded = Application.streamedBytes;
//        if(bytesLoaded > 0)
//        {
//            if(showOverallStatus)
//            {
//                float percentComplete = Application.GetStreamProgressForLevel(Application.levelCount - 1) * 100.0f;
//                if(percentComplete < 100.0f)
//                {
//                    string loadingMessage = "Loading" + "".PadRight((int)(Time.timeSinceLevelLoad % 3.0f) + 1, '.');
//                    GUI.Label(new Rect(-865.0f, 400.0f, 320.0f, 80.0f), "", "textArea");
//                    GUI.Label(new Rect(-850.0f, 415.0f, 290.0f, 40.0f), loadingMessage, "ScoreLabel");
//                    GUI.Label(new Rect(-850.0f, 415.0f, 290.0f, 40.0f), percentComplete.ToString("#,##0") + "%", "RightLabel");
//                    if(barTexture != null)
//                    {
//                        float width = 290.0f * percentComplete / 100.0f;
//                        GUI.DrawTexture(new Rect(-850.0f, 460.0f, width, 10.0f), barTexture);
//                    }
//                }
//            }
			
//            if(showSceneStatus)
//            {
//                float scenePercentComplete = Application.GetStreamProgressForLevel(statusScene) * 100.0f;
//                if(scenePercentComplete < 100.0f)
//                {
//                    GUI.Label(new Rect(-300.0f, -80.0f, 600.0f, 160.0f), "", "textArea");
//                    GUI.Label(new Rect(-300.0f, -80.0f, 600.0f, 160.0f), "", "textArea");
//                    GUI.Label(new Rect(-200.0f, -80.0f, 400.0f, 80.0f), "Loading...", "CenterLabel");
				
//                    GUI.Label(new Rect(-300.0f, 10.0f, 600.0f, 40.0f), scenePercentComplete.ToString("#,##0") + "%", "CenterLabel");
//                    if(barTexture != null)
//                    {
//                        float width = 570.0f * scenePercentComplete / 100.0f;
//                        GUI.DrawTexture(new Rect(-285.0f, 55.0f, width, 10.0f), barTexture);
//                    }
//                }
//            }
//        }
		
//        #if PROFILE
//        profiler.StopTiming();
//        #endif
//    }

//}
