From UE_ReactUMG
ReactUMG 对齐/居中与可见性/显隐枚举值速查。在设置水平对齐、垂直对齐、HorizontalAlignment、VerticalAlignment、Visibility、隐藏/显示组件时激活。注意 Center=2(不是1)、Visible=0、Collapsed=1 等常见混淆点。
npx claudepluginhub 15195999826/lomomarketplace --plugin UE_ReactUMGThis skill uses the workspace's default tool permissions.
| 值 | 枚举名 | 说明 |
Designs game UIs using Unity's UI Toolkit (USS/UXML/Flexbox) for HUDs, health bars, inventories, skill bars, with PanelSettings scaling and Safe Area support.
Generates Makepad layout code for sizing, aligning, positioning UI widgets with Walk, Align, Fit, Fill, flow, padding. Explains centering and responsive layouts in Makepad UIs.
Provides TypeScript patterns for React: props interfaces, event handlers, hooks, generic components, forwardRef, type-safe context, utility types, discriminated unions.
Share bugs, ideas, or general feedback.
| 值 | 枚举名 | 说明 |
|---|---|---|
| 0 | HAlign_Fill | 填充 |
| 1 | HAlign_Left | 左对齐 |
| 2 | HAlign_Center | 居中 |
| 3 | HAlign_Right | 右对齐 |
| 值 | 枚举名 | 说明 |
|---|---|---|
| 0 | VAlign_Fill | 填充 |
| 1 | VAlign_Top | 顶部 |
| 2 | VAlign_Center | 居中 |
| 3 | VAlign_Bottom | 底部 |
| 值 | 枚举名 | 说明 |
|---|---|---|
| 0 | Visible | 可见,可交互 |
| 1 | Collapsed | 折叠(不渲染,不占空间) |
| 2 | Hidden | 隐藏(不渲染,但占空间) |
| 3 | HitTestInvisible | 可见,不响应点击 |
| 4 | SelfHitTestInvisible | 可见,自身不响应(子元素可响应) |
// ❌ 错误:1 不是 Center
HorizontalAlignment: 1, // 这是 Left!
VerticalAlignment: 1, // 这是 Top!
// ✅ 正确:2 才是 Center
HorizontalAlignment: 2, // Center
VerticalAlignment: 2, // Center
// OverlaySlot 居中对齐
const overlaySlot: OverlaySlot = {
HorizontalAlignment: 2, // Center (不是 1!)
VerticalAlignment: 2, // Center (不是 1!)
};
// VerticalBoxSlot 水平居中
const centerSlot: VerticalBoxSlot = {
HorizontalAlignment: 2, // Center
};
// 控制可见性
<Border Visibility={isVisible ? 0 : 1} /> // 0=Visible, 1=Collapsed
OverlaySlot, VerticalBoxSlot, HorizontalBoxSlot, BorderSlot, ButtonSlot, GridSlot, BackgroundBlurSlot