Newer
Older
TEST / Assets / Scripts / Cell.cs
@a_kuznecov a_kuznecov on 20 Jun 2023 645 bytes First Commit
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Cell : MonoBehaviour
{
    public Item ItemInCell;
    public int columnId;
    public int X;
    public int Y;
    public bool endCell;
    public bool CellForCheckGameOver;

    private void OnTriggerStay2D(Collider2D collision)
    {
        if (collision.GetComponent<Item>() && !endCell)
        {
            ItemInCell = collision.GetComponent<Item>();
        }
    }
    private void OnTriggerExit2D(Collider2D collision)
    {
        if (collision.GetComponent<Item>() && !endCell)
        {
            ItemInCell = null;
        }
    }
}