int count = 1;
public UILabel numTxt;//预设体上面的文本
public void Add()//添加物品的数量方法
{
count++;//一直累加
numTxt.text = count.ToString();//赋值给文本
}
protected override void OnDragDropRelease(GameObject surface)
{
base.OnDragDropRelease(surface);
print(surface);//碰撞的物体
if (surface.CompareTag("GeZi"))
{
//物品居中
transform.parent = surface.transform;//把靴子放到格子里面
transform.localPosition = Vector3.zero;//把靴子放在格子的正中间
}
else if (surface.CompareTag("WuPin"))
{
//物品交换