public void win() { wonGame = true; winText.SetActive(true); menuScript ms = GameObject.FindWithTag("Menu").GetComponent <menuScript>(); ms.Restarting(); Time.timeScale = 0; }
//Handle player Damage //To-do: player death public void takeDamage(int dmg) { rb2d.velocity = Vector2.zero; hp -= dmg; setHpCounter(); hurteffects(); if (hp <= 0) { LoseText.SetActive(true); menuScript ms = GameObject.FindWithTag("Menu").GetComponent <menuScript>(); ms.Restarting(); Time.timeScale = 0; } }