コード例 #1
0
 void Awake()
 {
     //Anim = GetComponent<Animator> ();
     hud = gameController.GetComponent <HUDcontroller>();
     hud.SetHealth(Health / 100);
     game = gameController.GetComponent <GameController> ();
 }
コード例 #2
0
 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();
     }
 }