public void SUPER() { if (superFill.fillAmount == 1) { isSuper = true; super = 0; superText.color = new Color(0.1568628f, 0.1568628f, 0.1568628f); outline.Play("New State"); superFill.fillAmount = 0; // do it leftPlayer.CancelInvoke(); leftPlayer.InvokeRepeating("SUPER", 0, .10f); rightPlayer.CancelInvoke(); rightPlayer.InvokeRepeating("SUPER", 0, .10f); StartCoroutine(Super()); } }
public void GameOver() { if (over == 0) { /*GameCenter.GetComponent<Animator>().Play("GameCenter"); * Settings.GetComponent<Animator>().Play("Settings"); * PlayButton.GetComponent<Animator>().Play("Play");*/ HealthBar.GetComponent <Animator>().Play("HealthBarReverse", -1, 0); Color1.GetComponent <Animator>().Play("Colo1Reverse"); Color2.GetComponent <Animator>().Play("Color2Reverse"); Color3.GetComponent <Animator>().Play("Color3Reverse"); if (LeftSpawner != null) { LeftSpawner.CancelInvoke(); RightSpawner.CancelInvoke(); } else if (left != null) { left.CancelInvoke(); right.CancelInvoke(); } else { doubleSpawner.CancelInvoke(); } LeftPlayer.CancelInvoke(); RightPlayer.CancelInvoke(); if (LeftPlayer1 != null) { LeftPlayer1.CancelInvoke(); RightPlayer1.CancelInvoke(); LeftPlayer2.CancelInvoke(); RightPlayer2.CancelInvoke(); } plane.Play("game-end", -1, 0); leaderboard.gameObject.SetActive(true); leaderboard.Play("leaderboard-in"); volume.gameObject.SetActive(true); volume.Play("volume-in"); PlayButton.gameObject.SetActive(true); PlayButton.Play("play-in"); leftSide.gameObject.SetActive(true); leftSide.Play("leftSideIn"); //score.Play("ScoreOut"); //highScore.Play("highScoreOut"); SuperButton.Play("SuperOut"); pause.Play("PauseOut"); cc.EnableStars(); //plane.Play("PlanePositionReverse"); over++; if (flood != null) { flood.Stop(); } if (ct != null) { ct.GameOver(); } if (Color11 != null) { Color11.GetComponent <Animator>().Play("Colo1Reverse", -1, 0f); Color22.GetComponent <Animator>().Play("Color2Reverse", -1, 0f); Color33.GetComponent <Animator>().Play("Color3Reverse", -1, 0f); if (SuperButton1 != null) { SuperButton1.Play("SuperOut", -1, 0); int score = PlayerPrefs.GetInt("highScore_6_2", 0); score++; PlayerPrefs.SetInt("highScore_6_2", score); } } } }