Unity编辑器 - DragAndDrop拖拽控件
Unity编辑器的拖拽(DragAndDrop)在网上能找到的资料少,自己稍微研究了一下,写了个相对完整的案例,效果如下
代码:
object dragData = "dragData";
Vector2 offset;
Color col = new Color(1, 0, 0, 0.6f);
Rect rect1 = new Rect(20, 10, 100, 20);
Rect rect2 = new Rect(20, 60, 100, 20);
Rect drect;
bool isDraging;
int cid;
private void OnGUI() {
GUI.Box