Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit b896037

Browse files
committed
[Feature] Add Drag&Drop Readme
1 parent 9bb27dc commit b896037

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README-ZH.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,18 @@ UIWidgets支持渲染文本中包含的表情。表情的图片来自[https://ww
226226
如果您希望使用自己的表情图片,请更新纹理图`Tests/Resources/Emoji.png`,以及`Runtime/ui/txt/emoji.cs`中将Unicode映射到纹理图中具体位置的映射表。
227227
特别地,请记得更新Dictionary变量`emojiLookupTable`,纹理图的行数`rowCount`以及纹理图的列数`colCount`
228228

229+
#### 十一、与GameObject进行拖拽交互
230+
231+
<div style="text-align: center">
232+
<img src="https://connect-prd-cdn.unity.com/20190718/p/images/e3c9cf9b-c732-4eb2-9afd-fe7de894f342_Custom_Inspector_Showcase_320px.gif" width="300"/>
233+
</div>
234+
235+
UIWidgets也可以在EditorWindow上以及在游戏进程非运行状态下运行,因此我们可以使用它来编绘实用且美观的小组件来拓展编辑器。
236+
237+
我们提供了一个包装好的`UnityObjectDetector`组件以及`onRelease`回调函数,借此您可以实现简单地将物体(例如Hierarchy内的场景物体、Project窗口下的文件等)拖拽至区域内,来获得`UnityEngine.Object[] `类型的引用并进行操作。
238+
239+
你可以在“UIWidgetsTests -> Drag&Drop”下找到简单的实例样例。
240+
229241

230242
## 调试UIWidgets应用程序
231243

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,18 @@ and the unicode-index table in `Runtime/ui/txt/emoji.cs` which maps unicodes to
265265
in the texture. Specifically, remember to update the Dictionary `emojiLookupTable`, number of rows
266266
in the texture `rowCount`, and number of columns `colCount`.
267267

268+
#### Interact with GameObject Drag&Drops
269+
270+
<div style="text-align: center">
271+
<img src="https://connect-prd-cdn.unity.com/20190718/p/images/e3c9cf9b-c732-4eb2-9afd-fe7de894f342_Custom_Inspector_Showcase_320px.gif" width="300"/>
272+
</div>
273+
274+
UIWidgets can also be run on the EditorWindow without playing the runtime mode, thus, we can build some useful and pretty widgets to expand the editor.
275+
276+
With the provided packaged stateful widget `UnityObjectDetector` and its `onRelease` callback function, you can easily drag some objects (for example GameObject from Hierarchy, files from Project Window, etc) into the area, get the UnityEngine.Object[] references and make further modification.
277+
278+
Please refer to "UIWidgetsTests -> Drag&Drop" for simple examples.
279+
268280

269281
## Debug UIWidgets Application
270282

0 commit comments

Comments
 (0)