using UnityEngine;

namespace MenuMap
{
    public class LevelTrigger : MonoBehaviour
    {
        [SerializeField] private int levelIndex;

        private void OnTriggerEnter2D(Collider2D col)
        {
            if (col.CompareTag("Player"))
            {
                MapCharacterController.BlockMovement?.Invoke(true);
                OpenLevelPanel.ShowAndSetPanel?.Invoke(levelIndex);
            }
        }
    }
}