using System;
using UnityEngine;

public class MarketPopcornView : MonoBehaviour
{
    private static readonly int Place = Animator.StringToHash("Place");
    [SerializeField] private Animator animator;
    [SerializeField] private RarityView rarityView;

    public void SetActive(bool active, bool animate = false)
    {
        gameObject.SetActive(active);
        if (active && animate)
        {
            animator.SetTrigger(Place);   
        }
    }

    public void ChangeRarity(ProductRarity rarity)
    {
        rarityView.SetRarity(rarity);
    }
}
