private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "Bullet") { player.GotHit(); if (player.GetHealth() == 0) { Destroy(gameObject); SceneManager.LoadScene("P1Win"); } } }
// Update is called once per frame void Update() { healthText.text = player.GetHealth().ToString(); }
// Update is called once per frame void Update() { healthBar.value = playerCharacter.GetHealth(); HPText.text = "HP: " + playerCharacter.GetHealth() + "/" + playerCharacter.healthMax; }
// Update is called once per frame void Update() { healthText.text = player.GetHealth().ToString(); //calls GetHealth function from player.cs }