UIAnchor
UIAnchor Class Reference
UIAnchor类引用
This script can be used to anchor an object to the side of the screen, or scale an object to always match the dimensions of the screen.More...
UIAnchor类ReferenceThis脚本可以用来锚定一个对象到屏幕的边上,或缩放象来匹配屏幕的尺寸。更多…
成员列表
Public Types公共类型 | |
enum | Side 边 |
Public Member Functions公共成员函数 | |
void | Update () |
Anchor the object to the appropriate point. 锚对象到适当的点。 | |
Public Attributes公共属性 | |
Camera | uiCamera = null //绘制Ui的摄像机 |
Side | side = Side.Center //枚举值 中心 |
bool | halfPixelOffset = true //偏移半个像素 躲避Direct的一个Bug |
bool | stretchToFill = false //拉伸填充 |
float | depthOffset = 0f //深度偏移 |
补充:
Vector2 relativeOffset = Vector2.zero //相对偏移
Detailed Description详细描述
This script can be used to anchor an object to the side of the screen, or scale an object to always match the dimensions of the screen.
这个脚本可以用来锚定一个对象的两边的屏幕上,或规模对象总是匹配屏幕的尺寸。
Member Function Documentation
成员函数文档
void OnEnable () //Automatically find the camera responsible for drawing the widgets under this object.自动找到照相机负责绘制窗口小部件在这个对象。