StoneのBLOG

生活这种事情,从来都是自我陶醉

0%

UE5-CommonUI插件

CommonUI是UE推出的新的UI插件,本质上还是UMG那一套,相比于原来的基础系统,为我们做了一点使用上的简化。

Overview

CommonUI-GuideLine

上面是UE5.2版本的CommonUI插件的官方文档。在CommonUI相关的文档相对较少的现在,官方文档的内容就显得至关重要了。

Should I use CommonActivatableWidget or CommonUserWidget?
Not every CommonUI widget should be an Activatable Widget. A widget should only be an activatable widget if it needs to affect Input Routing on an on or off basis.

If the widget you are creating only needs to interact with CommonUI’s Input Routing system to handle input by itself, consider creating a CommonUserWidget or a regular User Widget. CommonUserWidgets form the basis of many of CommonUI’s classes, including UCommonButtonBase and UCommonTabListWidgetBase. Tooltips are a good example of a case where Activatable Widgets can be counterproductive since tooltips tend to quickly appear and disappear, don’t need to forward input to child widgets, and don’t need to seize input from the rest of your UI.

If the widget you are creating has multiple interactable children or needs to block input handling from the rest of your UI, then using an Activatable Widget is preferable. Pop-up windows and modal menus are good examples of this kind of behavior.

Debug Tips

Slate Debugger

我怎么忘了,还有一个超级好用的工具,之前有用过的。

观察Log

可以使用Log LogCommonUI Verbose提高Log输入等级,观察CommonUI的日志。尤其重要的是Focus的移动。