public void lifeOn() { //player[playerCo.myNumberForGameOver].enabled = false; playerCo.ThePlayerUsedIsLife = true; PlayerPrefs.SetInt("boughtLife", 0); Time.timeScale = 1; track.setSpeed(true); playerLoss[playerCo.myNumberForGameOver].SetActive(true); lifeButtonOff.SetActive(true); lifeButtonOn.SetActive(false); Gameover.SetActive(false); }
void OnTriggerEnter2D(Collider2D other) { if (!BonusActive) { if (other.name == "lamp2(Clone)" || other.name == "RoadSignTempWHIAT(Clone)" || other.name == "RoadSignTemp(Clone)" || other.name == "lamp3(Clone)" || other.name == "lamp1(Clone)" || other.name == "Fpool4Move 1(Clone)" || other.name == "Fpool4Red(Clone)" || other.name == "front" || other.name == "airplaneNew2(Clone)" || other.name == "airplaneNew4(Clone)" || other.name == "roadSign4(Clone)") { anim.SetBool("isDied", true); player.deathSound.Play(); Time.timeScale = 0; //if animation with name "Attack" finished thePlayerLose = true; track.setSpeed(false); bacgroundMusic.Stop(); } BonusActive = false; } }