【Unity】UGUI怎么计算RectTransform中的Top和Bottom的值
来源:互联网 发布:微擎人人商城源码下载 编辑:程序博客网 时间:2024/05/21 09:22
这个是我在使用UGUI中最蛋疼的一个属性,它明明就在那里,但是你却无法调用.....
所以所以所以,我查了和试了它的好多方法,终于解决了......希望对大家有所帮助
using UnityEngine;using System.Collections;using UnityEngine.UI;/// <summary>/// 脚本位置:UGUI的图片/// </summary>public class test : MonoBehaviour {// 你的图片private RectTransform mySprite ;void Start () {mySprite = gameObject.GetComponent<RectTransform>();}void Update () {// max.y返回的偏移量是个负数,所以需要乘以-1Debug.Log("Top" + ":" + mySprite.offsetMax.y * -1);Debug.Log("Bottom" + ":" + mySprite.offsetMin.y );}}
0 0
- 【Unity】UGUI怎么计算RectTransform中的Top和Bottom的值
- 【Unity】UGUI中RectTransform中Top和Bottom的设置,宽和高的设置,以及postion和锚点的设置
- UGUI 计算RectTransform的Bounds
- Unity UGUI 的RectTransform参数的设置
- Unity UGUI 的RectTransform参数的设置
- recttransform 和transform unity
- Unity UGUI 原理篇(三):RectTransform
- Unity UGUI 原理篇(三):RectTransform
- UGUI - RectTransform
- UGUI RectTransform
- 【UGUI】uGUI RectTransform
- altium designer 中的top/bottom solder和top/bottom paste mask
- 关于UGUI RectTransform的几个参数的获取和修改(待补充)
- Unity RectTransform
- Unity3d UGUI 自适应屏幕 代码修改Left,Top,Right,Bottom属性值
- DXP中的top/bottom solder和…
- css中的relative相对定位的top bottom left right
- 【UGUI进阶】RectTransform剖析
- (转)Android 模仿淘宝滑动查看图片的效果 Gallery + ImageSwitcher
- 堆排序
- 实现DIV层内的文字垂直居中
- 全排列问题:序号与排列转换
- hdu 5447 Good Numbers(数论)
- 【Unity】UGUI怎么计算RectTransform中的Top和Bottom的值
- Ajax Post 传输对象或数组的解决方案
- linux常用命令(59):grep命令
- JQuery中$.load()方法的用法和分析【转】
- APK加固之类抽取分析与修复
- ICV hash校验值不符的问题
- rz和sz 和他们的参数们
- HTTP协议详解(版本二)
- effective c++ 令operator=返回一个reference to *this