private void Start() { HealthPostureSystem healthPostureSystem = new HealthPostureSystem(); SetHealthPostureSystem(healthPostureSystem); //CMDebug.ButtonUI(new Vector2(-100, -150), "Health Damage", () => healthPostureSystem.HealthDamage(10)); //CMDebug.ButtonUI(new Vector2(-100, -200), "Health Heal", () => healthPostureSystem.HealthHeal(10)); //CMDebug.ButtonUI(new Vector2(+100, -150), "Posture Increase", () => healthPostureSystem.PostureIncrease(10)); //CMDebug.ButtonUI(new Vector2(+100, -200), "Posture Decrease", () => healthPostureSystem.PostureDecrease(10)); }
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; }