using UnityEngine;

namespace MyGame.Scenes.CornField.Scripts
{
    public class FertilizerEffectView : MonoBehaviour
    {
        [SerializeField] private GameObject feverFrontLight;
        [SerializeField] private GameObject feverBackLight;
        [SerializeField] private Animator soilTopLightAnimator;
        [SerializeField] private Animator soilCenterLightAnimator;
        [SerializeField] private Animator soilBottomLightAnimator;
        private static readonly int HashSoilLight = Animator.StringToHash("Base Layer.SoilLight");
        private static readonly int HashWait = Animator.StringToHash("Base Layer.Wait");
        
        public void SetActive(bool active){
            feverFrontLight.SetActive(active);
            feverBackLight.SetActive(active);
            soilTopLightAnimator.Play(active ? HashSoilLight : HashWait);
            soilCenterLightAnimator.Play(active ? HashSoilLight : HashWait);
            soilBottomLightAnimator.Play(active ? HashSoilLight : HashWait);
        }
    }
}