Ejemplo n.º 1
0
 public void TakeDamage(float damage)
 {
     stats.life -= damage;
     lifeBar.Set(stats.life, stats.maxLife);
     if (stats.life <= 0)
     {
         Die();
     }
 }
Ejemplo n.º 2
0
 void Start()
 {
     myPathThroughLife  = route.path;
     transform.position = myPathThroughLife[index].transform.position;
     Recalculate();
     health = maxHealth;
     barControl.Set(health, maxHealth);
     // Setup Bar Follow
     barControl.GetComponent <Follow>().target    = transform;
     barControl.GetComponent <Follow>().barOffset = barOffset;
 }