Пример #1
0
    private void OnGUI()
    {
        if (!EscapeMenu.show)
        {
            return;
        }
        Rect position = new Rect(0f, 0f, (float)Screen.width, (float)Screen.height);

        GUI.DrawTexture(position, this.tLoad);
        if (EscapeMenu.state == 0)
        {
            GUI.DrawTexture(new Rect(GUI2.YRES(60f), GUI2.YRES(128f), GUI2.YRES(256f), GUI2.YRES(32f)), this.tLogo);
            if (this.DrawButton(this.rButton[0], Lang.Get("_RESUME"), Lang.Get("_resume_to_game"), _Color.Gray))
            {
                EscapeMenu.Toggle();
            }
            if (this.DrawButton(this.rButton[1], Lang.Get("_VOTE"), Lang.Get("_vote_menu"), _Color.Gray))
            {
                EscapeMenu.Toggle();
                Vote.SetActive(true);
            }
            if (this.DrawButton(this.rButton[2], Lang.Get("_HELP"), Lang.Get("_tip_control"), _Color.Gray))
            {
                EscapeMenu.state = 1;
            }
            if (ScoreBoard.gamemode != 3)
            {
                if (this.DrawButton(this.rButton[3], Lang.Get("_CHOOSE_TEAM"), Lang.Get("_change_team_ingame"), _Color.Gray))
                {
                    EscapeMenu.Toggle();
                    ChooseTeam.Toggle();
                }
            }
            else
            {
                GUI2.DrawTextRes(this.rButton[3], Lang.Get("_CHOOSE_TEAM"), TextAnchor.MiddleRight, _Color.Gray, 1, 14, true);
            }
            if (this.DrawButton(this.rButton[4], Lang.Get("_FULLSCREEN"), Lang.Get("_open_game_in_fullscreen"), _Color.Gray))
            {
                EscapeMenu.Toggle();
                Options.ToggleFullScreen();
            }
            if (this.DrawButton(this.rButton[5], Lang.Get("_OPTIONS"), string.Empty, _Color.Gray))
            {
                EscapeMenu.state = 2;
                MenuOptions.ForceCenter();
                MenuOptions.SetActive(true);
            }
            if (this.DrawButton(this.rButton[6], Lang.Get("_EXIT_MENU"), Lang.Get("_progress_not_saved"), _Color.Yellow))
            {
                EscapeMenu.Toggle();
                global::Console.cs.Command("disconnect");
            }
        }
        else if (EscapeMenu.state == 1)
        {
            this.DrawHelp();
        }
        else if (EscapeMenu.state == 2)
        {
            MenuOptions.Draw();
        }
        if (this.DrawButton(new Rect(GUI2.YRES(60f), GUI2.YRES(400f), GUI2.YRES(64f), GUI2.YRES(32f)), Lang.Get("_BACK"), string.Empty, _Color.Gray))
        {
            EscapeMenu.Toggle();
        }
        GUI2.DrawTextRes(new Rect(GUI2.YRES(60f), GUI2.YRES(420f), GUI2.YRES(64f), GUI2.YRES(32f)), "ESC", TextAnchor.MiddleRight, _Color.Red, 2, 23, true);
    }