浏览代码

Merge branch 'zxw/support_editor_dragdrop' of github.com:Unity-Technologies/com.unity.uiwidgets into zxw/support_editor_dragdrop

/zxw-support_editor_dragdrop
Xingwei Zhu 3 年前
当前提交
7d2eb262
共有 3 个文件被更改,包括 48 次插入0 次删除
  1. 43
      engine/src/shell/platform/unity/windows/uiwidgets_panel.cc
  2. 5
      engine/src/shell/platform/unity/windows/uiwidgets_panel.h

43
engine/src/shell/platform/unity/windows/uiwidgets_panel.cc


}
}
void UIWidgetsPanel::OnDragUpdateInEditor(float x, float y)
{
if (process_events_) {
UIWidgetsPointerEvent event = {};
event.x = x;
event.y = y;
SetEventPhaseFromCursorButtonState(&event);
event.signal_kind = UIWidgetsPointerSignalKind::kUIWidgetsPointerSignalKindEditorDragUpdate;
SendPointerEventWithData(event);
}
}
void UIWidgetsPanel::OnDragReleaseInEditor(float x, float y)
{
if (process_events_) {
UIWidgetsPointerEvent event = {};
event.x = x;
event.y = y;
SetEventPhaseFromCursorButtonState(&event);
event.signal_kind = UIWidgetsPointerSignalKind::kUIWidgetsPointerSignalKindEditorDragRelease;
SendPointerEventWithData(event);
}
}
static uint64_t ConvertToUIWidgetsButton(int button) {
switch (button) {
case -1:

UIWidgetsPanel_onScroll(UIWidgetsPanel* panel, float x, float y, float px, float py) {
panel->OnScroll(x, y, px, py);
}
UIWIDGETS_API(void)
UIWidgetsPanel_onDragUpdateInEditor(UIWidgetsPanel* panel, float x, float y) {
if (!panel->NeedUpdateByEditorLoop()) {
return;
}
panel->OnDragUpdateInEditor(x, y);
}
UIWIDGETS_API(void)
UIWidgetsPanel_onDragReleaseInEditor(UIWidgetsPanel* panel, float x, float y) {
if (!panel->NeedUpdateByEditorLoop()) {
return;
}
panel->OnDragReleaseInEditor(x, y);
}
} // namespace uiwidgets

5
engine/src/shell/platform/unity/windows/uiwidgets_panel.h


void OnMouseLeave();
void OnDragUpdateInEditor(float x, float y);
void OnDragReleaseInEditor(float x, float y);
bool NeedUpdateByPlayerLoop();
bool NeedUpdateByEditorLoop();

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存