LetGameStop() public method

public LetGameStop ( bool stop ) : void
stop bool
return void
Esempio n. 1
0
    void OnGUI()
    {
        if (gskin)
        {
            GUI.skin = gskin;
        }

        if (dead)
        {
            Time.timeScale = 0.000001f;
            Gretacontroller.LetGameStop(true);
            mouse.SetGameStop(true);


            GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), DeadBackground, ScaleMode.StretchToFill, true);

            if (GUI.Button(new Rect(Screen.width / 2 - 250, Screen.height / 2, 192, 48), "Continue", "MenuButton"))
            {
                dead           = false;
                Time.timeScale = 1.0f;
                Gretacontroller.LetGameStop(false);
                mouse.SetGameStop(false);
                loadRecord();
                Application.LoadLevel(PlayerPrefs.GetString("loadScene"));
            }
            if (GUI.Button(new Rect(Screen.width / 2 + 50, Screen.height / 2, 192, 48), "Exit Game", "MenuButton"))
            {
                Time.timeScale = 1.0f;
                dead           = false;
                Gretacontroller.LetGameStop(false);
                mouse.SetGameStop(false);
                Application.LoadLevel("StartMenu");
            }
        }
    }
Esempio n. 2
0
    void OnGUI()
    {
        GUI.depth = this.guidepth;
        e         = Event.current;
        if (e.isMouse)
        {
            if (e.button.Equals(1))
            {
                SetCursor(true);
            }
        }
        if (e.type.Equals(EventType.MouseUp) && !isOpenMenu)
        {
            SetCursor(false);
        }



        if (MainMenuGUI)
        {
            GUI.skin = MainMenuGUI;
        }

        GUI.skin.horizontalSlider      = MainMenuGUI_Slider.horizontalSlider;
        GUI.skin.horizontalSliderThumb = MainMenuGUI_Slider.horizontalSliderThumb;


        Background.color = new Color(0.5f, 0.5f, 0.5f, MenuSmoothMove * 0.5f);

        if (GUI.Button(new Rect(0.0f, Screen.height - 472 + (Screen.height + 472) * (1 - MenuSmoothMove), 192, 48), "Display", "MenuButton"))
        {
            MenuLayer = 1;
        }

        if (GUI.Button(new Rect(0.0f, Screen.height - 402 + (Screen.height + 402) * (1 - MenuSmoothMove), 192, 48), "Music", "MenuButton"))
        {
            MenuLayer = 2;
        }

        if (GUI.Button(new Rect(0.0f, Screen.height - 332 + (Screen.height + 332) * (1 - MenuSmoothMove), 192, 48), "Exit Game", "MenuButton"))
        {
            Time.timeScale = 1.0f;
            Greta.LetGameStop(false);
            Mouse.SetGameStop(false);
            Application.LoadLevel("StartMenu");
        }

        if (GUI.Button(new Rect(0.0f, Screen.height - 262 + (Screen.height + 262) * (1 - MenuSmoothMove), 192, 48), "Back", "MenuButton"))
        {
            Time.timeScale = 1.0f;
            Greta.LetGameStop(false);
            Mouse.SetGameStop(false);
            MenuLayer  = 0;
            isOpenMenu = false;
        }

        GUI.DrawTexture(new Rect(0, Screen.height - 192, 192, 192), Radar, ScaleMode.StretchToFill, true);
        if (GUI.Button(new Rect(0, Screen.height - 55.5f, 55.5f, 55.5f), "", "MainMenu"))
        {
            Background.enabled = true;
            isOpenMenu         = true;
            Greta.LetGameStop(true);
            Mouse.SetGameStop(true);
            Time.timeScale = 0.0000001f;
            if (e.isMouse)
            {
                if (e.button.Equals(1))
                {
                    SetCursor(true);
                }
            }
            if (e.type.Equals(EventType.MouseUp) && !isOpenMenu)
            {
                SetCursor(false);
            }
        }

        if (isOpenMenu)
        {
            if (MenuLayer == 0)
            {
                //Map
            }


            #region Display Windows
            if (MenuLayer == 1)
            {
                GUI.Label(new Rect(Screen.width / 2 - 220, Screen.height / 2 - 200, 200, 32), "Resolution", "Option_Title");
                GUI.Label(new Rect(Screen.width / 2 + 32, Screen.height / 2 - 200, 128, 32), resolutions[res_index].width.ToString() + " X " + resolutions[res_index].height.ToString(), "Label");
                if (GUI.Button(new Rect(Screen.width / 2, Screen.height / 2 - 200, 32, 32), "", "ArrowButtonStyle_Left"))
                {
                    if (res_index > 0)
                    {
                        res_index--;
                    }
                    else
                    {
                        res_index = res_count;
                    }
                }
                if (GUI.Button(new Rect(Screen.width / 2 + 160, Screen.height / 2 - 200, 32, 32), "", "ArrowButtonStyle_Right"))
                {
                    if (res_index < res_count - 1)
                    {
                        res_index++;
                    }
                    else
                    {
                        res_index = 0;
                    }
                }
                GUI.Label(new Rect(Screen.width / 2 - 220, Screen.height / 2 - 130, 200, 32), "Fullscreen", "Option_Title");
                GUI.Label(new Rect(Screen.width / 2 + 32, Screen.height / 2 - 130, 128, 32), isFS_Yes, "Label");
                if (GUI.Button(new Rect(Screen.width / 2, Screen.height / 2 - 130, 32, 32), "", "ArrowButtonStyle_Left"))
                {
                    if (isFullscreen)
                    {
                        isFullscreen = false;
                        isFS_Yes     = "NO";
                    }
                    else
                    {
                        isFullscreen = true;
                        isFS_Yes     = "YES";
                    }
                }
                if (GUI.Button(new Rect(Screen.width / 2 + 160, Screen.height / 2 - 130, 32, 32), "", "ArrowButtonStyle_Right"))
                {
                    if (isFullscreen)
                    {
                        isFullscreen = false;
                        isFS_Yes     = "NO";
                    }
                    else
                    {
                        isFullscreen = true;
                        isFS_Yes     = "YES";
                    }
                }
                GUI.Label(new Rect(Screen.width / 2 - 220, Screen.height / 2 - 60, 200, 32), "SSAO", "Option_Title");
                GUI.Label(new Rect(Screen.width / 2 + 32, Screen.height / 2 - 60, 128, 32), SSOA_Str[SSAO], "Label");
                if (GUI.Button(new Rect(Screen.width / 2, Screen.height / 2 - 60, 32, 32), "", "ArrowButtonStyle_Left"))
                {
                    if (SSAO > 0)
                    {
                        SSAO--;
                    }
                    else
                    {
                        SSAO = 3;
                    }
                }
                if (GUI.Button(new Rect(Screen.width / 2 + 160, Screen.height / 2 - 60, 32, 32), "", "ArrowButtonStyle_Right"))
                {
                    if (SSAO < 3)
                    {
                        SSAO++;
                    }
                    else
                    {
                        SSAO = 0;
                    }
                }
                //Optmize Setting
                GUI.Label(new Rect(Screen.width / 2 - 220, Screen.height / 2 + 10, 200, 32), "Optmization", "Option_Title");
                GUI.Label(new Rect(Screen.width / 2 + 32, Screen.height / 2 + 10, 128, 32), Optmize_str[Optmize], "Label");
                if (GUI.Button(new Rect(Screen.width / 2, Screen.height / 2 + 10, 32, 32), "", "ArrowButtonStyle_Left"))
                {
                    if (Optmize == 0)
                    {
                        Optmize = 1;
                    }
                    else if (Optmize == 1)
                    {
                        Optmize = 0;
                    }
                }
                if (GUI.Button(new Rect(Screen.width / 2 + 160, Screen.height / 2 + 10, 32, 32), "", "ArrowButtonStyle_Right"))
                {
                    if (Optmize == 0)
                    {
                        Optmize = 1;
                    }
                    else if (Optmize == 1)
                    {
                        Optmize = 0;
                    }
                }

                //Quality Setting
                GUI.Label(new Rect(Screen.width / 2 - 220, Screen.height / 2 + 80, 200, 32), "Quality Level", "Option_Title");
                GUI.Label(new Rect(Screen.width / 2 + 32, Screen.height / 2 + 80, 128, 32), Quality_Str[Quality], "Label");
                if (GUI.Button(new Rect(Screen.width / 2, Screen.height / 2 + 80, 32, 32), "", "ArrowButtonStyle_Left"))
                {
                    if (Quality > 0)
                    {
                        Quality--;
                    }
                }
                if (GUI.Button(new Rect(Screen.width / 2 + 160, Screen.height / 2 + 80, 32, 32), "", "ArrowButtonStyle_Right"))
                {
                    if (Quality < 5)
                    {
                        Quality++;
                    }
                }
                if (GUI.Button(new Rect(Screen.width / 2 + 112, Screen.height / 2 + 150, 64, 32), "Apply", "Option_Button"))
                {
                    ApplySetting();
                    ApplySetting();
                }
                if (GUI.Button(new Rect(Screen.width / 2 + 16, Screen.height / 2 + 150, 64, 32), "Back", "Option_Button"))
                {
                    MenuLayer = 0;
                }
            }
            #endregion

            #region Music Windows
            if (MenuLayer == 2)
            {
                GUI.Label(new Rect(Screen.width / 2 - 220, Screen.height / 2 - 200, 200, 32), "Music Volume", "Option_Title");
                GameMusicVolume = (int)GUI.HorizontalSlider(new Rect(Screen.width / 2, Screen.height / 2 - 189, 128, 32), GameMusicVolume, 0, 10);
                //GUI.Label(new Rect(Screen.width / 2 + 135, Screen.height / 2 - 200, 32, 32), GameMusicVolume.ToString(), "Label");

                GUI.Label(new Rect(Screen.width / 2 - 220, Screen.height / 2 - 130, 200, 32), "Sound Volume", "Option_Title");
                GameSoundVolume = (int)GUI.HorizontalSlider(new Rect(Screen.width / 2, Screen.height / 2 - 119, 128, 32), GameSoundVolume, 0, 10);
                //GUI.Label(new Rect(Screen.width / 2 + 135, Screen.height / 2 - 130, 32, 32), GameSoundVolume.ToString(), "Label");

                if (GUI.Button(new Rect(Screen.width / 2 + 112, Screen.height / 2 + 150, 64, 32), "Apply", "Option_Button"))
                {
                    ApplySetting();
                }

                if (GUI.Button(new Rect(Screen.width / 2 + 16, Screen.height / 2 + 150, 64, 32), "Back", "Option_Button"))
                {
                    MenuLayer = 0;
                }
            }
            #endregion
        }
    }