您当前的位置: 首页 >  ui

苍狼王unity学院

暂无认证

  • 1浏览

    0关注

    305博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

UGUI的RectTransform脚本控制。

苍狼王unity学院 发布时间:2019-11-04 17:37:45 ,浏览量:1

1.改变RectTransform的top

GetComponent().offsetMax = new Vector2(GetComponent().offsetMax.x, top);

2.改变RectTransform的bottom GetComponent().offsetMin = new Vector2(GetComponent().offsetMin.x, bottom);

3.改变RectTransform的width,height GetComponent().sizeDelta = new Vector2(width, height);

4.改变RectTransform的pos GetComponent().anchoredPosition3D = new Vector3(posx,posy,posz); GetComponent().anchoredPosition = new Vector2(posx,posy);

关注
打赏
1665389160
查看更多评论
立即登录/注册

微信扫码登录

0.2497s