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

public class Border : MonoBehaviour
{
    public Item itemNeeded;
    public BoxCollider2D forestCollider;

    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.transform.CompareTag("Player"))
        {

            Debug.Log("JE TOUCHE LA BORDEER");
            if (Inventory.instance.hasItem(itemNeeded))
            {
                Debug.Log("Je poss�de l'item n�cessaire");
                forestCollider.enabled = false;

            }
            else
            {
                Debug.Log("Je n'ai pas l'item n�cessaire");

                switch (itemNeeded.id)
                {
                    case 1:
                        Dialog.instance.setSituation("borderChaussure");
                        break;
                    case 2:
                        Dialog.instance.setSituation("borderBaton");
                        break;
                    case 3:
                        Dialog.instance.setSituation("borderRechaud");
                        break;
                    case 4:
                        Dialog.instance.setSituation("borderTente");
                        break;
                }
            }
        }
    }


}