public void LostrestartGame() { FadePanelController newFade = FindObjectOfType <FadePanelController>(); newFade.LostnewGame(); StartCoroutine(WaitCo()); }
public void LoseGame() { tryAgainPanel.SetActive(true); board.currentState = GameState.lose; Debug.Log("Вы проиграли!"); //Debug.Log(levelButton.starsActive); //if (gameData != null) //{ // gameData.saveData.stars[board.level] = 0; //} //else //{ // gameData.saveData.stars[board.level] = 0; //} currentCounterValue = 0; counter.text = "" + currentCounterValue; FadePanelController fade = FindObjectOfType <FadePanelController>(); fade.GameOver(); // вылет панели анимация Music.PlaySound("Lose"); }
public IEnumerator LoseGame() { int win = PlayerPrefs.GetInt("winpanel"); board.currentState = GameState.lose; yield return(new WaitForSeconds(0.9f)); if (win != 1) { TryAgainPanel.SetActive(true); } //if (win != 1) //{ // TryAgainPanel.SetActive(true); // Debug.Log("Wiiiiiiiiiiiiiiin" + win); //} btn = GameObject.FindGameObjectWithTag("btn").GetComponent <Button>(); eBtn = GameObject.FindGameObjectWithTag("btne").GetComponent <Button>(); int coin = PlayerPrefs.GetInt("Coin"); if (coin < 900) { btn.interactable = false; } else { btn.enabled = true; } int energy = PlayerPrefs.GetInt("totalEnergy"); if (energy <= 0) { eBtn.interactable = false; } else { eBtn.enabled = true; } Debug.Log("You Lose"); currentCounterValue = 0; counter.text = "" + currentCounterValue; FadePanelController fade = FindObjectOfType <FadePanelController>(); fade.GameOver(); yield return(new WaitForSeconds(1f)); PlayerPrefs.SetInt("panel", 1); }
public void PauseGame() { pausePanel.SetActive(true); Debug.Log("You Lose"); FadePanelController fade = FindObjectOfType <FadePanelController>(); fade.GameOver(); board.currentState = GameState.paused; }
public void LoseGame() { tryAgainPanel.SetActive(true); board.currentState = GameState.paused; currentCounterValue = 0; counter.text = "" + currentCounterValue; FadePanelController fade = FindObjectOfType <FadePanelController>(); fade.GameOver(); }
public void WinGame() { youWinPanel.SetActive(true); board.currentState = GameState.win; currentCounterValue = 0; counter.text = "" + currentCounterValue; FadePanelController fade = FindObjectOfType <FadePanelController>(); fade.GameOver(); }
public void LoseGame() { tryAgainPanel.SetActive(true); board.currentState = GameState.lose; Debug.Log("Try again"); currentCounterValue = 0; counter.text = currentCounterValue.ToString(); FadePanelController fade = FindObjectOfType <FadePanelController>(); fade.GameOver(); }
public void LoseGame() { tryAgainPanel.SetActive(true); board.currentState = GameState.lose; Debug.Log("You lose!"); currentCounterValue = 0; timeCounter.text = "" + currentCounterValue; FadePanelController fade = FindObjectOfType <FadePanelController>(); fade.GameOver(); }
public void WinGame() { //youWinPanel.SetActive(true); Invoke("YouWinPanel", 2); // задержка в появлении панели board.currentState = GameState.win; //currentCounterValue = 0; currentCounterValue = requirements.counterValue; counter.text = "" + currentCounterValue; FadePanelController fade = FindObjectOfType <FadePanelController>(); fade.GameOver(); Music.PlaySound("Win"); }
public void WinGame() { if (finished) { return; } youWinPanel.SetActive(true); board.currentState = Gamestate.win; currentCounterValue = 0; counter.text = "" + currentCounterValue; FadePanelController fade = FindObjectOfType <FadePanelController>(); fade.GameOver(); scoreManager.EndScreenStars(board.scoreGoals); finished = true; }
public IEnumerator WinGame() { //coin += 10; board.currentState = GameState.win; yield return(new WaitForSeconds(0.8f)); PlayerPrefs.SetInt("winpanel", 1); YouWinPanel.SetActive(true); //coin += 10; //Debug.Log("coin" + coin); currentCounterValue = 0; counter.text = "" + currentCounterValue; FadePanelController fade = FindObjectOfType <FadePanelController>(); fade.GameOver(); yield return(new WaitForSeconds(1f)); PlayerPrefs.SetInt("panel", 1); }
public void UpdateGoals() { int goalsCompleted = 0; for (int i = 0; i < levelGoals.Length; i++) { currentGoals[i].text.text = levelGoals[i].numberColected + "/" + levelGoals[i].numberNeeded; if (levelGoals[i].numberColected >= levelGoals[i].numberNeeded) { goalsCompleted++; currentGoals[i].text.text = levelGoals[i].numberNeeded + "/" + levelGoals[i].numberNeeded; } } if (goalsCompleted >= levelGoals.Length) { if (endGameManager != null) { endGameManager.WinGame(); FadePanelController fade = FindObjectOfType <FadePanelController>(); fade.GameOver(); Debug.Log("You win!!"); } } }
public void WinGame() { if (board.AllJuice == true || board.someJuice) { audioSource.enabled = true; if (!audioSource.isPlaying) { audioSource.clip = winSound; audioSource.Play(); } } if (board.AllJuice == true) { winParticale.SetActive(true); } youWinPanel.SetActive(true); PrintMetrics.levelScore[PrintMetrics.currentLevel] = scoreManager.score; if (PrintMetrics.currentLevel >= 2) { PrintMetrics.WriteString(); } else { PrintMetrics.currentLevel++; } board.currentState = GameState.win; currentCounterValue = 0; counter.text = "" + currentCounterValue; FadePanelController fade = FindObjectOfType <FadePanelController>(); fade.GameOver(); }