Skip to content
Snippets Groups Projects
Forked from Chirz / CityEscape
243 commits behind the upstream repository.
Border.cs 672 B
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Border : MonoBehaviour
{
    public Item itemNeeded;
    public Inventory inventory;
    public BoxCollider2D collider;

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

            Debug.Log("JE TOUCHE LA BORDEER");
            if (inventory.hasItem(itemNeeded))
            {
                Debug.Log("Je possde l'item ncessaire");
                collider.enabled = false;

            }
            else
                Debug.Log("Je ne possde pas l'item ncessaire");

        }
    }


}