using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class BossHealthBar : MonoBehaviour{ public Slider slider; // The health bar public Gradient gradient; // The color of the health public Image healthFill; // The image for the health // Same as the player health bar public void SetBossMaxHealth(int health){ slider.maxValue = health; slider.value = health; healthFill.color = gradient.Evaluate(1f); } public void SetBossHealth(int health){ slider.value = health; healthFill.color = gradient.Evaluate(slider.normalizedValue); } }