ugui记录
ugui用到了RectTransform,对ugui的操作 很多体现在RectTransform上:
RectTransform rectT = go.GetComponent<RectTransform>();
if (texture.width > texture.height)
{
rectT.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, originalWidth);
rectT.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, texture.height * originalWidth / texture.width);
}RectTransform rectT = go.GetComponent<RectTransform>();
rectT.offsetMax = new Vector2(-170, tmpY);RectTransform rectT = txt0.GetComponent<RectTransform>();
Vector3 vec = rectT.localPosition;
rectT.localPosition = new Vector3(vec.x, -70, vec.z);声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
- 上一篇:没有了
- 下一篇: 为什么要乘以unity_Scale.w?
