protected override void Execute(List <UnitEntity> entities) { foreach (var e in entities) { _hpBar.UpdateHp(e.hitpoint.Value); } }
public void UpdateHp(int hp) { _hpBar?.UpdateHp(hp); if (hp <= 0) { _gameOverWindow.Show(); } }
/*void Update () { * SetInfo(stats.alert.ToString(), Color.yellow); * }*/ // ===================================================== // Stats // ===================================================== public virtual void UpdateHp(int ammount) { stats.hp += ammount; if (stats.hp > stats.hpMax) { stats.hp = stats.hpMax; } if (stats.hp < 0) { stats.hp = 0; } bar.UpdateHp(); }
public void UpdateUnitHitpoint(HitpointComponent hp) { HpBar.UpdateHp(hp.Value); }