Skip to content

midgithub/DragDropComponents

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

用法详见工程中附带的示例,场景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, and alse an extra universalMatching property is provided;
  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;
  7. The max count of Items one Target can be attached to is configurable, and so is the behaviour when more Items are attached(replace the first attached or not)

For more details please run Scene or view TestScript.

About

DragDrop components based on UGUI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%