47 lines
592 B
C#
47 lines
592 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class UI_ItemCell : MonoBehaviour
|
|
{
|
|
private Vector2Int gridPosition;
|
|
|
|
private bool isEmpty = true;
|
|
|
|
public Vector2Int GridPosition
|
|
{
|
|
get
|
|
{
|
|
return gridPosition;
|
|
}
|
|
private set
|
|
{
|
|
gridPosition = value;
|
|
}
|
|
}
|
|
|
|
public bool IsEmpty
|
|
{
|
|
get
|
|
{
|
|
return isEmpty;
|
|
}
|
|
set
|
|
{
|
|
if (value)
|
|
{
|
|
GetComponent<Image>().color = Color.white;
|
|
}
|
|
else
|
|
{
|
|
GetComponent<Image>().color = Color.red;
|
|
}
|
|
isEmpty = value;
|
|
}
|
|
}
|
|
|
|
public void Initialize(Vector2Int gridPosition)
|
|
{
|
|
GridPosition = gridPosition;
|
|
}
|
|
}
|