public void SetAbility(ActiveChargeAbility ability) { if (this.ability != null) { ability.on_charge_changed -= (a, new_number_charges) => SetSlider(new_number_charges); } if (ability != null) { ability_image.sprite = ability.icon; ability.on_charge_changed += (a, new_number_charges) => SetSlider(new_number_charges); } else { ability_image.sprite = null; } this.ability = ability; SetSlider(ability.charges); }
public void SetActiveItemDisplay(ActiveChargeAbility ability) { charge_display.SetAbility(ability); }