using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class BossHealthBar : MonoBehaviour {
    public Slider mSlider;

    void Awake()
    {
        Observer.bossReadyHandler += OnBossReady;
        Observer.bossDamageHandler += OnBossDamage;
        Observer.bossCleanupHandler += OnBossCleanup;
    }

    void OnBossCleanup()
    {
        mSlider.gameObject.SetActive(false);
    }

    void OnBossReady()
    {
        mSlider.value = 3;
        mSlider.gameObject.SetActive(true);
    }

    void OnBossDamage(int health)
    {
        mSlider.value = health;
    }
}
