1.使用拖拽脚本进行拖拽
2.通过重写脚本
using UnityEngine;
using System.Collections;
public class MyDraDropitem : UIDragDropItem {
protected override void OnDragDropRelease(GameObject surface)
{
base.OnDragDropRelease(surface);
if (surface .transform.childCount>0)
{
}
else
{
}
this.transform.parent = surface.transform;
this.transform.localPosition = Vector3.zero;
}
}
3.通过节点
using UnityEngine;
using System.Collections;
public class Knapsack : MonoBehaviour {
public GameObject[] cells;
}
数组来确定cell的 位置
http://www.taikr.com/course/34/learn#lesson/1228