格式
typescript
UIComponent.uiPixelPerUnitX所属类: UIComponent
描述
当前UI在X轴方向上每个单位的像素数量。
参数
| 参数名 | 类型 | 描述 |
|---|
返回值
| 类型 | 描述 |
|---|---|
number |
代码示例
typescript
let go = new GameObject("ui");
let uiComponent = go.AddComponent<UIComponent>(UIComponent);
uiComponent.guiPrefab = Resources.Load<GUIPrefab>(GUIPrefab, "<UUID>");//<UUID>-为ui文件的uuid
uiComponent.uiPixelPerUnitX;