Unity-Technologies / com.unity.uiwidgets

UIWidgets is a Unity Package which helps developers to create, debug and deploy efficient, cross-platform Apps.
https://unity.cn/uiwidgets
626 stars 78 forks source link

fix input issue #308

Closed zhuxingwei closed 2 years ago

zhuxingwei commented 2 years ago

In this PR we aims to fix the issue #304 , in which: (1) we introduced a new concept of "Focus", which is used to indicate that which UIWidgetsPanel is currently active and able to accept keyboard events. At any time, there is only one UIWidgetsPanel that is "Focused"

(2) when a UIWidgetsPanel is created, the currently "Focused" panel will become this panel. If there are multiple UIWidgetsPanels and the user is clicking/dragging on one panel, this panel will also be made the currently "Focused" panel

(3) if a UIWidgetsPanel is destroyed and it is currently "Focused“, then no UIWidgetsPanel will be marked "Focused"

(4) Developers can also use the exposed API: Focusand UnFocusto implement your own customized logics