博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Unity UGUI 的RectTransform参数的设置
阅读量:7173 次
发布时间:2019-06-29

本文共 531 字,大约阅读时间需要 1 分钟。

1.改变RectTransform的top

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

 

2.改变RectTransform的bottom

GetComponent<RectTransform>().offsetMin = new Vector2(GetComponent<RectTransform>().offsetMin.x, bottom);

 

3.改变RectTransform的width,height

GetComponent<RectTransform>().sizeDelta = new Vector2(width, height);

 

4.改变RectTransform的pos

GetComponent<RectTransform>().anchoredPosition3D = new Vector3(posx,posy,posz);

GetComponent<RectTransform>().anchoredPosition = new Vector2(posx,posy);

转载地址:http://rlbzm.baihongyu.com/

你可能感兴趣的文章
JSON未定义
查看>>
背包整理(1) 01,完全,多重
查看>>
Common Linux log files name and usage--reference
查看>>
getServletContext()接口解析(收藏)
查看>>
PHP和shell脚本遍历目录及其下子目录
查看>>
iOS中使用block传值
查看>>
设计模式序章
查看>>
委托和事件
查看>>
C++的那些事:类的拷贝控制
查看>>
Word中表格内容被遮挡
查看>>
linux下vi命令大全
查看>>
angular性能优化心得
查看>>
Report_矩阵报表的实现(案例)
查看>>
修改Eclipse/MyEclipse项目的默认编码
查看>>
数据库中如何使用SQL查询连续号码段(转载)
查看>>
BPP
查看>>
Eclipse和PyDev搭建python开发环境
查看>>
IronPython脚本调用C#dll示例
查看>>
LuaInterface简介
查看>>
FreeBSD暂时用9.X系列为宜
查看>>