Exemple #1
0
    void OnMouseDown()
    {
        if (clicked)
        {
            return;
        }

        GetComponent <AudioSource>().PlayOneShot(clickAudio);

        clickedName = transform.name;
        switch (transform.name)
        {
        case "Resume":
        {
            guiScript.TogglePauseMenu();

            break;
        }

        case "QuitCancel":
        {
            guiScript.SetQuitMenuEnabled(false);

            break;
        }

        case "QuitConfirm":
        {
            Time.timeScale = 1;
            cam.FadeOut();

            GameManager.instance.levelID = 0;

            break;
        }

        case "InGameQuit":
        {
            guiScript.SetQuitMenuEnabled(true);

            break;
        }

        case "Quit":
        {
            guiScript.TogglePauseMenu();

            break;
        }

        case "Menu":
        {
            GameManager.instance.levelID = 0;
            Application.LoadLevel("MainMenu");

            break;
        }

        case "Continue":
        {
            GameManager.instance.levelID = 0;
            Application.LoadLevel("MainMenu");

            break;
        }

        case "Retry":
        {
            GameManager.instance.levelID = 0;
            cam.FadeOut();

            break;
        }

        case "Submit":
        {
            Application.LoadLevel("HighScores");

            break;
        }

        case "Skip":
        {
            Application.LoadLevel("MainMenu");

            break;
        }
        }

        clicked = true;
    }