Пример #1
0
 public void Refresh(bool NextLvl)
 {
     Next.SetActive(false);
     Again.SetActive(true);
     countPlayerDelay = 0.0f;
     Cowboy.GetComponent <Animator>().SetBool("Stand", false);
     infoPanel.SetActive(false);
     if (NextLvl)
     {
         LoadLevel(MainMenu.s_LvlToLoad += 1);
     }
     else
     {
         LoadLevel(MainMenu.s_LvlToLoad);
     }
 }
Пример #2
0
 private void TheEnd()
 {
     ShootBtn.GetComponent <BoxCollider2D>().enabled = false;
     if (win)
     {
         infoPanel.SetActive(true);
         if (MainMenu.s_LvlToLoad > 0 && MainMenu.s_LvlToLoad < 16)
         {
             Next.SetActive(true);
             Again.SetActive(false);
         }
         if (PlayerPrefs.HasKey(MainMenu.s_LvlToLoad.ToString()) || MainMenu.s_LvlToLoad < 0)
         {
             infoPanel.GetComponentInChildren <Text>().text = $"You Won\nYour Delay:{countPlayerDelay}" +
                                                              $"\nYou Found:{reward}$";
             MainMenu.s_Money += reward;
         }
         else
         {
             infoPanel.GetComponentInChildren <Text>().text = $"You Won\nYour Delay:{countPlayerDelay}" +
                                                              $"\nYou Found:{reward}$\nYour Reward:8$";
             MainMenu.s_Money += reward + 8;
         }
         if (PlayerPrefs.GetFloat(MainMenu.s_LvlToLoad.ToString()) > countPlayerDelay ||
             PlayerPrefs.GetFloat(MainMenu.s_LvlToLoad.ToString()) == 0)
         {
             PlayerPrefs.SetFloat(MainMenu.s_LvlToLoad.ToString(), countPlayerDelay);
         }
         if (MainMenu.s_Score > countPlayerDelay || MainMenu.s_Score == 0)
         {
             MainMenu.s_Score = countPlayerDelay;
             Save();
         }
         PlayerPrefs.SetInt("Money", MainMenu.s_Money);
     }
     else
     {
         infoPanel.SetActive(true);
         infoPanel.GetComponentInChildren <Text>().text = "You lost";
     }
 }