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; }
private void HealthPostureSystem_OnPostureChanged(object sender, System.EventArgs e) { // Posture changed, update bar SetPosture(healthPostureSystem.GetPostureNormalized()); }