/// <summary> /// Gets invoked when the energy of the player attached changed. /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event args</param> private void OnPlayerEnergyChanged(object sender, PlayerEnergyChangedEventArgs e) { this.HealthBarImage.fillAmount = (float)e.NewEnergy / 100F; }
/// <summary> /// Gets invoked when the energy of the player attached changed. /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event args</param> private void OnPlayerEnergyChanged(object sender, PlayerEnergyChangedEventArgs e) { this.EnergyDisplayText.text = string.Format("{0:0}%", e.NewEnergy); }