示例#1
0
 void backToMap()
 {
     StartCoroutine(FadingIntoCityMap());
     if (ButtonShop.paused)
     {
         ButtonShop.togglePause();
     }
     SaveManager.updateSave();
     PlayGamesScript.Instance.SaveData();
 }
示例#2
0
    void GameOver()
    {
        MusicManager.StopBGM();
        SfxManager.PlaySound("GameOver");
        StartCoroutine(playAfterTime(1f));

        ButtonShop.paused = false;
        ButtonShop.togglePause();
        gameOverScreen.SetActive(true);
    }
示例#3
0
    void again()
    {
        StartCoroutine(FadingIntoFightScene());
        if (ButtonShop.paused)
        {
            ButtonShop.togglePause();
        }

        SaveManager.updateSave();
        PlayGamesScript.Instance.SaveData();
    }
示例#4
0
 void win()
 {
     //pause game
     ButtonShop.togglePause();
     FloatingTextController.pause = true;
     scoreScreen.SetActive(true);
     GUIText[] allText = scoreScreen.GetComponentsInChildren <GUIText>();
     //Find the Text to change to correct amount
     foreach (GUIText i in allText)
     {
         if (i.text == "XXX Gold")
         {
             float goldEarned = SaveManager.Instance.goldEarned;
             i.text = goldEarned.ToString(".##") + " Gold";
             break;
         }
     }
 }
示例#5
0
    IEnumerator FadingIntoFightMap()
    {
        fadeAnim.SetBool("FadeOut", true);
        SaveManager.Instance.savePlayerPos();
        ButtonShop.togglePause();
        yield return(new WaitUntil(() => black.color.a == 1));

        if (gameObject.scene.name == "City map")
        {
            SceneManager.LoadScene("Fight scene");
        }
        else if (gameObject.scene.name == "Forest map")
        {
            SceneManager.LoadScene("Fight scene 1");
        }
        else if (gameObject.scene.name == "Snow map")
        {
            SceneManager.LoadScene("Fight scene 2");
        }
    }
示例#6
0
    IEnumerator FadingIntoFightScene()
    {
        fadeAnim.SetBool("FadeOut", true);
        ButtonShop.togglePause();
        resetFight();

        yield return(new WaitUntil(() => black.color.a == 1));

        //SceneManager.LoadScene(SceneManager.GetActiveScene().name);
        if (gameObject.scene.name == "Fight scene")
        {
            SceneManager.LoadScene("Fight scene");
        }
        else if (gameObject.scene.name == "Fight scene 1")
        {
            SceneManager.LoadScene("Fight scene 1");
        }
        else if (gameObject.scene.name == "Fight scene 2")
        {
            SceneManager.LoadScene("Fight scene 2");
        }
    }
示例#7
0
 void changePaused()
 {
     ButtonShop.togglePause();
 }