void Awake() { //Anim = GetComponent<Animator> (); hud = gameController.GetComponent <HUDcontroller>(); hud.SetHealth(Health / 100); game = gameController.GetComponent <GameController> (); }
public void TakeDamage(float danger) { hud.damaged = true; Health -= danger; hud.SetHealth(Health / 100); if (Health > 0) { //Anim.SetTrigger ("IsHit"); } else { //Anim.SetTrigger ("IsDie"); //gameObject.GetComponent<BoxCollider2D> ().isTrigger = true; gameObject.GetComponent <PlayerMove> ().enabled = false; game.gameOver(); } }