using UnityEngine;

public class LevelManager : MonoBehaviour
{
    [SerializeField] private GameplayChannel _gameplayChannel = null;
    [SerializeField] private SheepGenerator _sheepGenerator = null;

    private void Start()
    {
        if (_gameplayChannel != null)
            _gameplayChannel.onSheepStruck += CallbackOnSheepStruck;
    }

    private void OnDestroy()
    {
        if (_gameplayChannel != null)
            _gameplayChannel.onSheepStruck -= CallbackOnSheepStruck;
    }

    public void CallbackOnSheepStruck()
    {
        _sheepGenerator.CheckTotalValue();
    }
}
