|
|
||
|---|---|---|
| .. | ||
| README.md | ||
| TaskNodeNew.json | ||
| UI_Enemy_Building_Bar_New.json | ||
| UI_FlareCheckIn.json | ||
README.md
UI Prefab JSON 格式说明
结构
UIInfoNode {
name: string // GameObject 名称
active: boolean // 激活状态
components: [] // 组件列表
children: [] // 子节点(递归)
}
UIInfoComponent {
componentName: string // 组件类型名
enable: boolean // 启用状态
properties: string[] // 属性列表 "Key:Value" 格式
}
属性格式
| 类型 | 格式示例 |
|---|---|
| Vector2 | AnchoredPosition:0,0 |
| Vector3 | LocalPosition:0,0,0 |
| Color | Color:#RRGGBBAA |
| Bool | RaycastTarget:true |
| Enum | ImageType:Sliced |
| 引用 | Sprite:sprite_name 或空 |
RectTransform 属性
AnchorMin/Max:x,y- 锚点范围Pivot:x,y- 轴心点AnchoredPosition:x,y- 锚点位置AnchoredPosition3D:x,y,z- 3D锚点位置SizeDelta:x,y- 尺寸增量LocalPosition/Rotation/Scale- 本地变换
常见组件
- RectTransform: UI 变换信息
- Image: Sprite、Color、ImageType、FillAmount 等
- Text/TMP_Text: 文本内容、字体、对齐方式等
- Button: Transition 类型、颜色状态等
- CanvasRenderer: CullTransparentMesh 等