NLDClient-yudde/ProjectNLD/ExtractedPrefabs/README.md

47 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2026-02-04 15:05:24 +08:00
# 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 等