// Update is called once per frame void Update() { if (health <= 0) { healthbar.sizeDelta = new Vector2(520 * (health / 100), healthbar.rect.height); dead = true; isoRenderer.dieAnimation(); Invoke("mati", 1.0f); } else { healthbar.sizeDelta = new Vector2(520 * (health / 100), healthbar.rect.height); //Debug.Log("health: " + health); } }
// Update is called once per frame void Update() { if (health <= 0) { healthbar.sizeDelta = new Vector2(0.37f * (health / 50), healthbar.rect.height); dead = true; isoRenderer.dieAnimation(); Destroy(this.gameObject, 3.0f); Debug.Log("destroy"); } else { healthbar.sizeDelta = new Vector2(0.37f * (health / 50), healthbar.rect.height); //Debug.Log("health: " + health); } }