コード例 #1
0
 public void SetHealthPostureSystem(HealthPostureSystem healthPostureSystem)
 {
     // Set the HealthPostureSystem to display
     this.healthPostureSystem = healthPostureSystem;
     // Update starting values
     SetHealth(healthPostureSystem.GetHealthNormalized());
     SetPosture(healthPostureSystem.GetPostureNormalized());
     // Subscribe to changing events
     healthPostureSystem.OnHealthChanged  += HealthPostureSystem_OnHealthChanged;
     healthPostureSystem.OnPostureChanged += HealthPostureSystem_OnPostureChanged;
     healthPostureSystem.OnDead           += HealthPostureSystem_OnDead;
     healthPostureSystem.OnPostureBroken  += HealthPostureSystem_OnPostureBroken;
 }
コード例 #2
0
 private void HealthPostureSystem_OnPostureChanged(object sender, System.EventArgs e)
 {
     // Posture changed, update bar
     SetPosture(healthPostureSystem.GetPostureNormalized());
 }