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

public class BossBehavior : MonoBehaviour
{

    private Animator _animator;

    private GameObject _bossLogic;

    [SerializeField]
    private GameObject m_backButton;

    // Start is called before the first frame update
    void Start()
    {
        _animator = GetComponent<Animator>();
        _bossLogic = GameObject.FindGameObjectWithTag("BossLimbsCounter");
    }

    void OnEnable()
    {
        _bossLogic = GameObject.FindGameObjectWithTag("BossLimbsCounter");
        if (_bossLogic.GetComponent<BossLimbsCounter>().bossWasSeen == true)
        {
            _animator.SetBool("seenBoss", true);
        }
    }

    public void BossKilled()
    {
        m_backButton.SetActive(false);
    }

    public void BossWasSeen()
    {
        if (_bossLogic.GetComponent<BossLimbsCounter>().bossWasSeen == true) 
        {
            return; 
        }
        else
        {
            _bossLogic.GetComponent<BossLimbsCounter>().bossWasSeen = true;
        }
    }
}
