private void Awake()
    {
        if (Application.isEditor)
        {
            GameData.MATCH_MODE = GameData.Build.DEBUG;
        }
        if (GameData.MyPlayStatus > 1)
        {
            getMissionInProgressUpdate();
        }
        GL.ClearWithSkybox(true, Camera.main);
        GameObject    gameObject    = GameObject.Find("Tracker");
        TrackerScript trackerScript = gameObject.GetComponent("TrackerScript") as TrackerScript;

        trackerScript.AddMetric(TrackerScript.Metric.IN_HANGAR);
        trackerScript.updateMetricStats();
        GameObject gameObject2 = GameObject.Find("NetworkManager");

        m_networkManager          = (gameObject2.GetComponent("NetworkManager") as NetworkManager);
        m_state                   = Home;
        Camera.main.renderingPath = RenderingPath.UsePlayerSettings;
        if (GameData.eventObjects.ContainsKey("platform"))
        {
            GameObject gameObject3 = Object.Instantiate(GameData.eventObjects["platform"] as GameObject) as GameObject;
            GUIUtil.mInstance.mBackground = gameObject3.transform;
        }
    }
    private void OnGUI()
    {
        curhover           = ((Event.current.type != EventType.Repaint) ? lastHover : string.Empty);
        GUIUtil.GUIEnabled = true;
        GUI.BeginGroup(new Rect(screenSpace.x, screenSpace.y, 100000f, 200000f));
        GUI.skin  = mSharedSkin;
        GUI.depth = 5;
        string str = (GameData.MyPlayStatus <= 1) ? "Guest " : string.Empty;

        str = str + " " + GameData.getFactionDisplayName(GameData.MyFactionId);
        GUIUtil.mInstance.mModelRenderer.transform.rotation = Quaternion.identity;
        switch (NavState)
        {
        case 0:
            SetSuitTransform(tabhome.ModelTransform);
            tabhome.showTab(screenSpace);
            break;

        case 1:
            SetSuitTransform(tabshowcase.mSuitInspector.ModelTransforms[0]);
            tabshowcase.showTab(screenSpace);
            break;
        }
        GUI.color = Color.white;
        GUI.DrawTexture(new Rect(0f, 0f, screenSpace.width, 5f), Border);
        GUI.DrawTexture(new Rect(0f, screenSpace.height - 24f, screenSpace.width, 24f), Border);
        GUI.DrawTexture(new Rect(0f, 0f, 5f, screenSpace.height), Border);
        GUI.DrawTexture(new Rect(screenSpace.width - 5f, 0f, 5f, screenSpace.height), Border);
        GUIUtil.GUIEnableOverride(bEnable: true);
        GUI.Box(new Rect(FlagPos - 43.5f, 5f, 257f, 20f), GameData.getFactionDisplayName(GameData.MyFactionId).ToUpper(), "FactionFlagTop");
        GUIUtil.GUIEnable(bEnable: true);
        GUI.BeginGroup(new Rect(screenSpace.width - (float)XPCreditsImg.width, screenSpace.height - (float)XPCreditsImg.height, XPCreditsImg.width, XPCreditsImg.height));
        GUI.DrawTexture(new Rect(0f, 0f, XPCreditsImg.width, XPCreditsImg.height), XPCreditsImg);
        GUI.Label(new Rect(0f, 0f, XPCreditsImg.width, XPCreditsImg.height), GameData.MyTotalCredits.ToString(), "Credits");
        if (GameData.MyLevel == 50)
        {
            GUI.Box(new Rect(10f, 72f, 243f, 26f), GUIContent.none, "MaxLevel");
        }
        else
        {
            GUI.Box(new Rect(12f, 74f, 50f + Mathf.Max(0f, 150f * (((float)GameData.MyTotalXP - (float)GameData.getExpNeededForLevel(GameData.MyLevel)) / (float)(GameData.getExpNeededForLevel(GameData.MyLevel + 1) - GameData.getExpNeededForLevel(GameData.MyLevel)))), 22f), GUIContent.none, "XPBar");
            GUI.Label(new Rect(0f, 0f, XPCreditsImg.width, XPCreditsImg.height), GameData.MyLevel.ToString(), "MyLevel");
            GUI.Label(new Rect(0f, 0f, XPCreditsImg.width, XPCreditsImg.height), (GameData.MyLevel + 1).ToString(), "NextLevel");
        }
        GUI.EndGroup();
        GUI.BeginGroup(new Rect(0f, screenSpace.height - (float)PlayerImgBG.height, PlayerImgBG.width, PlayerImgBG.height));
        GUI.DrawTexture(new Rect(0f, 0f, PlayerImgBG.width, PlayerImgBG.height), PlayerImgBG);
        if (avatarTexture != null)
        {
            GUI.DrawTexture(new Rect(4f, PlayerImgBG.height - 47, 43f, 43f), avatarTexture);
        }
        else
        {
            avatarTexture = (Resources.Load("HUD/avatar/" + GameHUD.avatar_images[GameData.MySuitID - 1]) as Texture2D);
        }
        GUI.EndGroup();
        GUI.BeginGroup(new Rect(0f, 0f, NavButtonsBG.width + 100, NavButtonsBG.height));
        GUI.DrawTexture(new Rect(NavIndicator, 37.5f, 87f, 79f), NavStateImg[(GameData.MyFactionId - 1) * 2 + NavState]);
        GUI.DrawTexture(new Rect(0f, 0f, NavButtonsBG.width, NavButtonsBG.height), NavButtonsBG);
        switch (GUIUtil.CustomButton(NavButtonTris, new Rect(6f, 5f, 81f, 72f), GUIContent.none, "Home" + GameData.MyFactionId))
        {
        case GUIUtil.GUIState.Click:
            curhover = "Home";
            GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
            DoTransition(0);
            break;

        case GUIUtil.GUIState.Hover:
        case GUIUtil.GUIState.Active:
            if (Event.current.type == EventType.Repaint)
            {
                curhover = "Home";
                if (lastHover != curhover)
                {
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                }
            }
            break;
        }
        switch (GUIUtil.CustomButton(NavButtonTris, new Rect(6f, 80f, 81f, 72f), GUIContent.none, "Hangar" + GameData.MyFactionId))
        {
        case GUIUtil.GUIState.Click:
            curhover = "Hangar";
            GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
            DoTransition(1);
            FirstUse.DoAction(FirstUse.Frame.RequiredAction.Open_Showcase);
            break;

        case GUIUtil.GUIState.Hover:
        case GUIUtil.GUIState.Active:
            if (Event.current.type == EventType.Repaint)
            {
                curhover = "Hangar";
                if (lastHover != curhover)
                {
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                }
            }
            break;
        }
        GUI.EndGroup();
        GUI.BeginGroup(new Rect(screenSpace.width - (float)PlayButtonBG.width, 0f, PlayButtonBG.width, PlayButtonBG.height));
        GUI.DrawTexture(new Rect(0f, 0f, PlayButtonBG.width, PlayButtonBG.height), PlayButtonBG);
        int num = (int)(Time.realtimeSinceStartup * 24f) % animmod;

        switch (GUIUtil.CustomButton(PlayButtonTris, new Rect(8f, 4f, 195f, 51f), GUIContent.none, "Battle" + GameData.MyFactionId))
        {
        case GUIUtil.GUIState.Inactive:
        case (GUIUtil.GUIState) 3:
        case (GUIUtil.GUIState) 5:
            GUI.DrawTexture(new Rect(8f, 4f, 195f, 51f), BattleText);
            break;

        case GUIUtil.GUIState.None:
            if (num < 20)
            {
                GUI.color = ((GameData.MyFactionId != 1) ? new Color(0.8f, 0.8f, 0.8f) : Color.yellow);
                GUI.DrawTexture(new Rect(6f, 4f, 174f, 50f), BattleButtonAnimFrames[num]);
                GUI.color = Color.white;
            }
            GUI.DrawTexture(new Rect(8f, 4f, 195f, 51f), BattleText);
            break;

        case GUIUtil.GUIState.Active:
            if (num < 20)
            {
                GUI.color = ((GameData.MyFactionId != 1) ? new Color(0.48f, 0.49f, 0.22f) : new Color(0.73f, 0.19f, 0.09f));
                GUI.DrawTexture(new Rect(6f, 4f, 174f, 50f), BattleButtonAnimFrames[num]);
                GUI.color = Color.white;
            }
            GUI.DrawTexture(new Rect(8f, 4f, 195f, 51f), BattleText);
            break;

        case GUIUtil.GUIState.Hover:
            if (Event.current.type == EventType.Repaint)
            {
                curhover = "Battle";
                if (lastHover != curhover)
                {
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                }
                if (num < 20)
                {
                    GUI.color = ((GameData.MyFactionId != 1) ? new Color(0.48f, 0.49f, 0.22f) : new Color(0.73f, 0.19f, 0.09f));
                    GUI.DrawTexture(new Rect(6f, 4f, 174f, 50f), BattleButtonAnimFrames[num]);
                    GUI.color = Color.white;
                }
                GUI.color = Color.black;
                GUI.DrawTexture(new Rect(8f, 4f, 195f, 51f), BattleText);
                GUI.color = Color.white;
            }
            break;

        case GUIUtil.GUIState.Click:
            curhover = "Battle";
            GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
            battleType = 1;
            m_networkManager.m_gameModeStr = GameMode.freeforall.ToString();
            break;
        }
        GUIUtil.GUIEnable(GameData.MyPlayStatus != 1 || GameData.MATCH_MODE == GameData.Build.DEBUG);
        switch (GUIUtil.CustomButton(PlayButtonTris, new Rect(176f, 4f, 195f, 51f), GUIContent.none, "TeamBattle" + GameData.MyFactionId))
        {
        case GUIUtil.GUIState.Inactive:
        case (GUIUtil.GUIState) 3:
        case (GUIUtil.GUIState) 5:
            GUI.DrawTexture(new Rect(176f, 4f, 195f, 51f), TeamBattleText);
            break;

        case GUIUtil.GUIState.None:
            GUI.color = ((GameData.MyFactionId != 1) ? new Color(0.8f, 0.8f, 0.8f) : Color.yellow);
            if (num < 20)
            {
                GUI.DrawTexture(new Rect(175f, 4f, 174f, 50f), BattleButtonAnimFrames[num]);
            }
            if (num >= 7 && num < 25)
            {
                GUI.DrawTexture(new Rect(158f, 4f, 174f, 50f), BattleButtonAnimFrames[num - 5]);
            }
            if (num >= 14 && num < 30)
            {
                GUI.DrawTexture(new Rect(141f, 4f, 174f, 50f), BattleButtonAnimFrames[num - 10]);
            }
            GUI.color = Color.white;
            GUI.DrawTexture(new Rect(176f, 4f, 195f, 51f), TeamBattleText);
            break;

        case GUIUtil.GUIState.Active:
            GUI.color = ((GameData.MyFactionId != 1) ? new Color(0.48f, 0.49f, 0.22f) : new Color(0.73f, 0.19f, 0.09f));
            if (num < 20)
            {
                GUI.DrawTexture(new Rect(175f, 4f, 174f, 50f), BattleButtonAnimFrames[num]);
            }
            if (num >= 7 && num < 25)
            {
                GUI.DrawTexture(new Rect(158f, 4f, 174f, 50f), BattleButtonAnimFrames[num - 5]);
            }
            if (num >= 14 && num < 30)
            {
                GUI.DrawTexture(new Rect(141f, 4f, 174f, 50f), BattleButtonAnimFrames[num - 10]);
            }
            GUI.color = Color.white;
            GUI.DrawTexture(new Rect(176f, 4f, 195f, 51f), TeamBattleText);
            break;

        case GUIUtil.GUIState.Hover:
            if (Event.current.type == EventType.Repaint)
            {
                curhover = "TeamBattle";
                if (lastHover != curhover)
                {
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                }
                GUI.color = ((GameData.MyFactionId != 1) ? new Color(0.48f, 0.49f, 0.22f) : new Color(0.73f, 0.19f, 0.09f));
                if (num < 20)
                {
                    GUI.DrawTexture(new Rect(175f, 4f, 174f, 50f), BattleButtonAnimFrames[num]);
                }
                if (num >= 7 && num < 25)
                {
                    GUI.DrawTexture(new Rect(158f, 4f, 174f, 50f), BattleButtonAnimFrames[num - 5]);
                }
                if (num >= 14 && num < 30)
                {
                    GUI.DrawTexture(new Rect(141f, 4f, 174f, 50f), BattleButtonAnimFrames[num - 10]);
                }
                GUI.color = Color.black;
                GUI.DrawTexture(new Rect(176f, 4f, 195f, 51f), TeamBattleText);
                GUI.color = Color.white;
            }
            break;

        case GUIUtil.GUIState.Click:
            curhover = "TeamBattle";
            GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
            battleType = 2;
            m_networkManager.m_gameModeStr = GameMode.team.ToString();
            break;
        }
        GUIUtil.GUIEnable(bEnable: true);
        GUI.EndGroup();
        GUI.Box(new Rect(50f, screenSpace.height - 20f, screenSpace.width - 55f, 16f), GameData.MyDisplayName.ToUpper(), "NameBanner" + GameData.MyFactionId);
        GUI.Box(new Rect(screenSpace.width - 124f, screenSpace.height - 20f, 4f, 16f), GUIContent.none, "Separator");
        GUI.Box(new Rect(screenSpace.width - 243f, screenSpace.height - 20f, 4f, 16f), GUIContent.none, "Separator");
        switch (GUIUtil.Toggle(new Rect(screenSpace.width - 120f, screenSpace.height - 20f, 115f, 16f), GameData.MyFactionId == 2, GUIContent.none, "FullScreen"))
        {
        case GUIUtil.GUIState.Click:
        case (GUIUtil.GUIState) 24:
        case (GUIUtil.GUIState) 40:
            curhover = "FullScreen";
            GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
            if (Screen.fullScreen)
            {
                Screen.SetResolution(900, 600, fullscreen: false);
            }
            else
            {
                Screen.SetResolution(Screen.currentResolution.width, Screen.currentResolution.height, fullscreen: true);
            }
            break;

        case GUIUtil.GUIState.Hover:
        case (GUIUtil.GUIState) 18:
        case (GUIUtil.GUIState) 20:
        case (GUIUtil.GUIState) 34:
        case (GUIUtil.GUIState) 36:
            if (Event.current.type == EventType.Repaint)
            {
                curhover = "FullScreen";
                if (lastHover != curhover)
                {
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                }
            }
            break;
        }
        switch (GUIUtil.Toggle(new Rect(screenSpace.width - 239f, screenSpace.height - 20f, 115f, 16f), GameData.MyFactionId == 2, GUIContent.none, "Options"))
        {
        case GUIUtil.GUIState.Click:
        case (GUIUtil.GUIState) 24:
        case (GUIUtil.GUIState) 40:
            curhover = "Options";
            GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
            DynamicOptions.bDrawing = true;
            FirstUse.DoAction(FirstUse.Frame.RequiredAction.Open_Options);
            break;

        case GUIUtil.GUIState.Hover:
        case (GUIUtil.GUIState) 18:
        case (GUIUtil.GUIState) 20:
        case (GUIUtil.GUIState) 34:
        case (GUIUtil.GUIState) 36:
            if (Event.current.type == EventType.Repaint)
            {
                curhover = "Options";
                if (lastHover != curhover)
                {
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                }
            }
            break;
        }
        if (bAllowSocial)
        {
            GUI.Box(new Rect(screenSpace.width - 362f, screenSpace.height - 20f, 4f, 16f), GUIContent.none, "Separator");
            switch (GUIUtil.Toggle(new Rect(screenSpace.width - 358f, screenSpace.height - 20f, 115f, 16f), GameData.MyFactionId == 2, GUIContent.none, "Friends"))
            {
            case GUIUtil.GUIState.Click:
            case (GUIUtil.GUIState) 24:
            case (GUIUtil.GUIState) 40:
                curhover = "Friends";
                GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
                bDrawFriends = !bDrawFriends;
                FirstUse.DoAction(FirstUse.Frame.RequiredAction.Open_Options);
                break;

            case GUIUtil.GUIState.Hover:
            case (GUIUtil.GUIState) 18:
            case (GUIUtil.GUIState) 20:
            case (GUIUtil.GUIState) 34:
            case (GUIUtil.GUIState) 36:
                if (Event.current.type == EventType.Repaint)
                {
                    curhover = "Friends";
                    if (lastHover != curhover)
                    {
                        GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                    }
                }
                break;
            }
        }
        if (battleType > 0 && !m_connected)
        {
            GameObject    gameObject    = GameObject.Find("Tracker");
            TrackerScript trackerScript = gameObject.GetComponent("TrackerScript") as TrackerScript;
            GameData.ConsecutiveGames = 0;
            trackerScript.AddMetric((battleType != 1) ? TrackerScript.Metric.REQUEST_TEAM_BATTLE : TrackerScript.Metric.REQUEST_BATTLE);
            trackerScript.updateMetricStats();
            GameData.BattleType      = battleType;
            GameData.IsChooserActive = false;
            Debug.Log("requesting battletype " + battleType);
            Connect();
        }
        GUI.EndGroup();
        if (m_DrawHolidayEvent != null)
        {
            m_DrawHolidayEvent();
        }
        if (m_isLogin)
        {
            GUI.Label(new Rect(10f, 90f, 90f, 100f), "TegId: ");
            GameData.MyTEGid = GUI.TextField(new Rect(100f, 90f, 150f, 20f), GameData.MyTEGid);
            GUI.Label(new Rect(270f, 90f, 90f, 100f), "AuthId: ");
            GameData.MyAuthid     = GUI.TextField(new Rect(370f, 90f, 200f, 20f), GameData.MyAuthid);
            GameData.MyPlayStatus = 3;
        }
        GUI.DrawTexture(BlackBox1, GUI.skin.GetStyle("blackbox").normal.background);
        GUI.DrawTexture(BlackBox2, GUI.skin.GetStyle("blackbox").normal.background);
        if (bAllowSocial && bDrawFriends && !DynamicOptions.bDrawing)
        {
            FriendsWindow.x = screenSpace.width - 358f;
            FriendsWindow.y = screenSpace.height - FriendsWindow.height - 27f;
            GUI.Window(1700, FriendsWindow, DrawFriendsList, GUIContent.none);
        }
        lastHover = curhover;
    }