コード例 #1
0
 /// <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;
 }
コード例 #2
0
 /// <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);
 }