void Update() { if (hasBeenAttacked) { hasBeenAttacked = false; if (hasArmor) { armor.UpdateArmorBar(); } UpdateLifeBar(); } lifeBar.transform.LookAt(GameManager.singleton.transform); }
void Start() { armor = GetComponent <ArmorSystem>(); initialLife = totalLife; unitsPerLife = GameManager.singleton.unitsPerLife; lifeBarMaterial = GameManager.singleton.lifeBarMaterial; if (armor != null) { hasArmor = true; } CreateBar(); if (hasArmor) { armor.CreateArmorBar(); armor.UpdateArmorBar(); } }