public override void InitialiseHealth(float maxHealth) { healthAccessors = this.GetComponent <IHealthAccessors>(); GameObject playerHud = GameObject.FindGameObjectWithTag("HUD"); IHudAccessors vitalityAccessors = playerHud.GetComponent <IHudAccessors>(); healthBar = vitalityAccessors.GetHealthBar(); healthBar.InitialiseBar(maxHealth); }
public override void InitialiseShield(float maxShield) { shieldAccessors = this.GetComponent <IShieldAccessors>(); GameObject playerHud = GameObject.FindGameObjectWithTag("HUD"); IHudAccessors vitalityAccessors = playerHud.GetComponent <IHudAccessors>(); shieldBar = vitalityAccessors.GetShieldBar(); shieldBar.InitialiseBar(maxShield); }