DragDropComponents icon indicating copy to clipboard operation
DragDropComponents copied to clipboard

DragDrop components based on UGUI

基于UGUI的拖拽组件系统,主要支持以下功能:

  1. Item的自由拖拽及与Target的附着;
  2. ItemTarget响应Enter、Exit、Attach、Detach等事件,并通过代理为其添加回调;
  3. 使用matchingChannel来限制只有特定通道的ItemTarget可以匹配;
  4. 使用matchingTag来识别不同的目标类别;
  5. 支持点击或长按Item使其从Target脱离;
  6. 除拖放之外,Item还支持响应点击事件,并兼容ScrollRect的拖动事件;

用法详见工程中附带的示例,场景Scene及脚本TestScript

test.gif


A Drag&Drop components system based on UGUI that has the following features:

  1. Drag Items freely and attach them to Targets;
  2. Items and Targets can receive callback events like Enter, Exit, Attach, Detach etc;
  3. Use matchingChannel to make sure that only Items and Targets with exact channels can match;
  4. Use matchingTag to identify different Item or Target types;
  5. Detach with long press is supported;
  6. Items can also receive click events and are able to work with drag events of a ScrollRect as well;

For more details please run Scene or view TestScript.